git - drone - ghost - guacamole - rocket chat https://sigyl.com/
This repository has been archived on 2020-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Giles Bradshaw 98aae8c614
continuous-integration/drone/push Build was killed Details
.
2020-04-29 12:38:54 +01:00
certificates initial 2020-04-02 13:20:50 +00:00
drone-starlark . 2020-04-29 12:38:54 +01:00
ghost initial 2020-04-02 13:20:50 +00:00
guacamole-postgresql . 2020-04-29 09:19:45 +01:00
letsencrypt-nginx . 2020-04-29 11:05:39 +01:00
ngrok-gitea . 2020-04-29 12:38:54 +01:00
.drone-do copy.star . 2020-04-28 18:41:26 +01:00
.drone-do.star . 2020-04-28 20:51:56 +01:00
.drone-home.star . 2020-04-29 09:19:45 +01:00
.drone-remote.star . 2020-04-28 21:49:51 +01:00
.drone.do.yml . 2020-04-27 13:02:15 +01:00
.drone.home.yml . 2020-04-25 21:33:40 +01:00
.drone.remote.yml . 2020-04-27 21:38:21 +01:00
.gitignore remote 2020-04-21 15:07:22 +01:00
README.md . 2020-04-29 11:05:39 +01:00
add-secret.png initial 2020-04-02 13:20:50 +00:00
build.sh . 2020-04-29 09:19:45 +01:00
docker-compose-do.yml . 2020-04-27 22:36:09 +01:00
docker-compose-drone.yml . 2020-04-25 21:33:40 +01:00
docker-compose-home.yml . 2020-04-29 12:38:54 +01:00
docker-compose-remote.yml . 2020-04-28 09:08:51 +01:00
init-mongo-chat.sh . 2020-04-29 09:19:45 +01:00
init-postgresql.sh . 2020-04-29 09:19:45 +01:00
init-scale.sh . 2020-04-29 09:19:45 +01:00
install.md . 2020-04-29 07:29:28 +01:00
letsencrypt-nginx-build.sh initial 2020-04-02 13:20:50 +00:00

README.md

stack

In a docker stack.

static ip

Build Status

drone.do.yml - docker-compose-do.yml

tunnelled with ngrok

(very slow if home internet)

Build Status

installation

Once installed and running the system can redeploy itself.

However initially you need to do this yourself.

docker

you need a docker swarm set up with nodes with the following labels

  • com.sigyl.git-stack=yes
  • com.sigyl.git-stack-data=yes

global environment

the following environment variables need to be defined (define your own values)

echo 'export SIGYL_STACK_ROOT=/stack/deploy' | sudo tee -a /etc/profile.d/sigyl-stack.sh
echo 'export SIGYL_STACK_NAME=stack' | sudo tee -a /etc/profile.d/sigyl-stack.sh

sh /etc/profile.d/sigyl-stack.sh

make a folder and give yourself access

sudo mkdir -p $SIGYL_STACK_ROOT
cd /stack
sudo chown -R $USER:$USER $SIGYL_STACK_ROOT

clone the repository

cd /stack
git clone https://sigyl.com/git/giles/stack.git $SIGYL_STACK_ROOT
cd $SIGYL_STACK_ROOT
git checkout home-deploy

make certificates for the registry

these certificates will be in .ca and .certificates where $REGISTRY_DOMAIN is the host where the stack will run it should be on the local subnet ie trafic should not have to go over the internet.

eg git.local-domain

cd $SIGYL_STACK_ROOT/certificates
sh ca.sh $REGISTRY_DOMAIN:5003
sh make-cert.sh $REGISTRY_DOMAIN registry

make environment variables

export CERTBOT_EMAIL=giles.bradshaw@sigyl.com
export DRONE_DOMAIN=drone.git.sigyl.com
export DRONE_GITEA_CLIENT_ID=
export DRONE_GITEA_SERVER=
export DRONE_SERVER_HOST=drone.git.sigyl.com
export GIT_DOMAIN=git.sigyl.com
export LOCAL_DOCKER_REGISTRY=git.local-domain:5003/
export SSH_USER=giles
export GUACAMOLE_POSTGRES_DB=guacamole_db
export GUACAMOLE_POSTGRES_USER=guacamole_user
export DRONE_CONVERT_SECRET=topsecret
export DRONE_GITEA_CLIENT_SECRET=
export DRONE_RPC_SECRET=topsecret2
export GUACAMOLE_POSTGRES_PASSWORD=[passwordnospaces]
export NGROK_AUTH_TOKEN=[secret token from ngrok]

build images

sh build.sh $SIGYL_STACK_ROOT

initial deploy of stack

cd $SIGYL_STACK_ROOT
docker stack deploy -c docker-compose-home.yml $SIGYL_STACK_NAME

initialise postgres database

find postgres id as $ID

docker ps | grep stack_guacamole-postgresql.1
sh init-postgresql.sh $ID

initialise mongo

get mongo id as $ID

docker ps | grep stack_chat-mongo.1
sh init-mongo-chat.sh $ID

scale chat and ngrok and nginx

sh init-scale.sh stack

create a gitea drone application

This might be on your local gitea or some other one.

set environment variables for it as follows (example values):

export DRONE_GITEA_SERVER=https://sigyl.com/git
export DRONE_GITEA_CLIENT_ID=38218ed5-cf18-47e7-1234-710173dae499
export DRONE_GITEA_CLIENT_SECRET=ytsgdyXI_6zUrqwsI1wsssBAaUcsp27EyecT4nk5fA=

redeploy

docker stack deploy -c docker-compose-home.yml $SIGYL_STACK_NAME
sh init-scale.sh stack