From a5435b0d78326950845764f993ba0757df9a9725 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Wed, 25 Jan 2023 16:47:17 +0900 Subject: [PATCH 1/3] Update repo name for frontend --- ci/script/deploy.sh | 2 +- docker-compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/script/deploy.sh b/ci/script/deploy.sh index 9862bf3..11f97d6 100755 --- a/ci/script/deploy.sh +++ b/ci/script/deploy.sh @@ -5,7 +5,7 @@ #$3 -> Port for the machine and the image PREFIX="[ARKultur] " -REPO="bogdzn" +REPO="arkulturtest" if [ "$( docker container inspect -f '{{.State.Running}}' $1 )" == "true" ]; then diff --git a/docker-compose.yml b/docker-compose.yml index b781c63..22024e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,8 +30,8 @@ services: restart: unless-stopped web: - image: bogdzn/theed:${CI_BRANCH} - container_name: theed + image: arkulturtest/sidious:${CI_BRANCH} + container_name: sidious ports: - "3000:3000" networks: From b0e17611c089c0a70fa76c513b006daeed55f64c Mon Sep 17 00:00:00 2001 From: Guillaume Date: Thu, 26 Jan 2023 16:47:53 +0900 Subject: [PATCH 2/3] Update start script --- start.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/start.sh b/start.sh index 676fddb..ade9b9a 100755 --- a/start.sh +++ b/start.sh @@ -2,7 +2,6 @@ PREFIX="[ARKultur] " -export CI_BRANCH=canon printf "%sStarting docker-compose...\n" "$PREFIX" docker-compose up -d --build printf "%sDocker compose started!\n" "$PREFIX" From a3c01d91bef889a3ba5be236460378228753b026 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Fri, 24 Mar 2023 15:03:51 +0900 Subject: [PATCH 3/3] Add README.md Update Caddyfile remove useless route Update docker-compose.yml Remove scripts/ --- README.md | 50 +++++++++++++++++++++++++++++++++++ configs/Caddyfile | 9 +------ docker-compose.yml | 5 ++-- scripts/rename_domain_name.sh | 7 ----- 4 files changed, 53 insertions(+), 18 deletions(-) create mode 100644 README.md delete mode 100755 scripts/rename_domain_name.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..2a95da4 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# Sentinel + +### Setup + +Clone the repo on your server, then define these environment variables: +``` +CI_BRANCH - Target branch to automaticly deploy a projet (ex: main, develop) +SITE_DOMAIN - Domain name of the projet (ex: arktest.example.com) +SITE_ADDRESS - Current address of the server where the CI are (ex: 145.144.67.98) +``` + +### Start + +Then when you have defined these variable you can juste run the command: +```shell +./start.sh +``` +It will start all instance of ARKultur based on the target branch `CI_BRANCH`. + +### Stop +If you want to stop the CI you can run the command: +```shell +./stop.sh +``` +This command stop all instance (it doesn't remove anything). + +### Configure auto deploy +When you run the command `./start.sh` the server who, auto deploy it also started, but +you have to link it with a GitHub webhook. +To do so go to: +- Repo's settings +- Webhooks +- Create a new one +- Content type: `application/json` +- Check: `Let me select individual events.` +- Uncheck: everything +- Check: `Workflow runs` + +For the payload in caddy's config we've set a route called `ci_deploy/`. \ +Add your server address (domain or IP) before this route (ex: https://example.com/ci_deploy). \ +Then save your change and check if the ping work. \ +If the configuration is good a new version of the project will be deployed when an action +called `docker` id successfully done. \ + +### Upgrade + +If you want to upgrade something in the project there is: +- `docker-compose.yml`: All information about containers +- `configd/`: Contain Caddy's config file +- `ci/`: Server which auto deploy a project \ No newline at end of file diff --git a/configs/Caddyfile b/configs/Caddyfile index 3b2a2dd..a20152b 100644 --- a/configs/Caddyfile +++ b/configs/Caddyfile @@ -8,14 +8,7 @@ } route /api/* { - reverse_proxy api:8080 - } - - route /pgadmin4 { - reverse_proxy pgadmin:8200 { - header_up X-Script-Name "/pgadmin4" - header_up Host {upstream_hostport} - } + reverse_proxy api:4000 } route /* { diff --git a/docker-compose.yml b/docker-compose.yml index 22024e3..ae23b11 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,14 +39,13 @@ services: restart: unless-stopped api: - image: bogdzn/naboo:${CI_BRANCH} + image: arkulturtest/naboo:${CI_BRANCH} container_name: naboo env_file: - .env-api - volumes: - - ./configs/api:/app ports: - "8080:8080" + - "4000:4000" depends_on: - db networks: diff --git a/scripts/rename_domain_name.sh b/scripts/rename_domain_name.sh deleted file mode 100755 index b4ed69f..0000000 --- a/scripts/rename_domain_name.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -INITIAL=arkultur.creative-rift.com -TARGET=arktest.creative-rift.com - -find . -type f -not -name ".env" \ - | xargs sed -i "s/${INITIAL}/${TARGET}/g"