From e3a907d7d5c0ca31ab3505f4d15495775d4ae2ee Mon Sep 17 00:00:00 2001 From: "Md. Ashikul Alam" Date: Fri, 15 Nov 2024 15:55:03 +0600 Subject: [PATCH 01/10] fix: update auth country config constant in docker compose --- infrastructure/docker-compose.app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/infrastructure/docker-compose.app.yml b/infrastructure/docker-compose.app.yml index 134573b7..2e2f6e22 100644 --- a/infrastructure/docker-compose.app.yml +++ b/infrastructure/docker-compose.app.yml @@ -422,6 +422,7 @@ services: - CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{STACK}}.{{ts}} - LOGIN_URL=https://login.${STACK}.{{hostname}} - COUNTRY_CONFIG_URL=https://countryconfig.${STACK}.{{hostname}} + - COUNTRY_CONFIG_URL_INTERNAL=https://countryconfig.${STACK}.{{hostname}} - CLIENT_APP_URL=https://register.${STACK}.{{hostname}} - DOMAIN=${STACK}.{{hostname}} - REDIS_HOST=redis.${STACK}_app_net From 1753e334f841ac3957d4219f2530a2c797fd38e6 Mon Sep 17 00:00:00 2001 From: "Md. Ashikul Alam" Date: Fri, 15 Nov 2024 15:56:11 +0600 Subject: [PATCH 02/10] chore: update ashikul access to server --- infrastructure/server-setup/inventory/qa.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/infrastructure/server-setup/inventory/qa.yml b/infrastructure/server-setup/inventory/qa.yml index f8eb45ce..a137f8c1 100644 --- a/infrastructure/server-setup/inventory/qa.yml +++ b/infrastructure/server-setup/inventory/qa.yml @@ -45,6 +45,11 @@ all: - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINMSNTIIsM0C3uJg3V/Fqh2gi4lvl2y6nenrb2Ft1JlX jamil31415926@gmail.com state: present sudoer: true + - name: ashikul + ssh_keys: + - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDFr/v3hUGEbc2wQsDLCmqLrwiz964yVrnLZ6kafemjmX8aRGLp1CNFvrZ674SLnXidZGMkx9d5xVvv8IdFR3R50MqSqfolF43MV34/JVHjQHh9Vk4MJT/3GIaeNmr2GQ/38qAmt2BQn1ecnb7FjNO2bFvHokLhm2wCXt+A4avuTgJe0p4e6uu01IHeIzDb5sPzZ3ID0h6jJnjEDcET+Lf5NGpCjn7YKhLhBWSSl9cXQdOGLzNzg3aBk32kgJ1beP1funSeVd0jniJPZeZRC1G/kRdqBUOHKiENtwgquzZxXzdHkZV9+4mF7YGlx6LpQdNuDpW7JADtYNldtdbexdyfrgNoRzKwyMmaKNDbeHd1FsIHSDJmGm9hCoLTM2dEtsGzgghfe0tat8sOWmsj5v2en0V8rKV+w8OQEmHtaQkgMjqmZaAnd8uWiB2xIbrUuax5Pq8zkj37xnfbRxUPOEkMlOUbhh1wzGbqeUEB7nbv/vXZxwC0b7ryMk5egBP+0ZRONsdib9RkSTr3B9uSb7iTOQftdhy+CTqqOq+6s+TyC2qnu12B1WZb9sx9jQl0mBHd9gx/FgYDs8jfIr2vF4jRkejW/moaVqvCd/FLyS91eCMXQjIXdGKWKPUUL7GEBqdZRLnYSJOqgPp9sk1+NEvMabTXlWmoUjaShq8z+o7JsQ== nileeeem36@gmail.com + state: present + sudoer: true enable_backups: false docker-manager-first: hosts: From 0e6611f35af621597c2dd4066ad20b63f4c73cf0 Mon Sep 17 00:00:00 2001 From: "Md. Ashikul Alam" Date: Fri, 15 Nov 2024 16:44:16 +0600 Subject: [PATCH 03/10] fix: update country config internal path --- infrastructure/docker-compose.app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/docker-compose.app.yml b/infrastructure/docker-compose.app.yml index 2e2f6e22..1623e594 100644 --- a/infrastructure/docker-compose.app.yml +++ b/infrastructure/docker-compose.app.yml @@ -422,7 +422,7 @@ services: - CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{STACK}}.{{ts}} - LOGIN_URL=https://login.${STACK}.{{hostname}} - COUNTRY_CONFIG_URL=https://countryconfig.${STACK}.{{hostname}} - - COUNTRY_CONFIG_URL_INTERNAL=https://countryconfig.${STACK}.{{hostname}} + - COUNTRY_CONFIG_URL_INTERNAL=http://countryconfig.{{STACK}}_app_net:3040/ - CLIENT_APP_URL=https://register.${STACK}.{{hostname}} - DOMAIN=${STACK}.{{hostname}} - REDIS_HOST=redis.${STACK}_app_net From 1eef073c07b6ae31549a6120b69c79f948e41f9b Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Tue, 19 Nov 2024 15:57:12 +0200 Subject: [PATCH 04/10] feat: allow setting branch when deploying --- .github/workflows/deploy.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f61d25a3..803c61fc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,6 +3,10 @@ run-name: Deploy ${{ inputs.stack }} with reset=${{ inputs.reset }} core=${{ inp on: workflow_call: inputs: + branch: + description: 'The branch to checkout. Defaults to the branch triggering the workflow.' + required: false + type: string core-image-tag: type: string description: Core DockerHub image tag @@ -69,6 +73,7 @@ jobs: with: fetch-depth: 1 path: './${{ github.event.repository.name }}' + ref: ${{ inputs.branch || github.ref_name }} - name: Checkout country branch run: | From f3b7bbf6168d8e81ae9cf184b31bd164daa82bed Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Tue, 19 Nov 2024 16:37:38 +0200 Subject: [PATCH 05/10] feat: allow deploying with a dispatch --- .github/workflows/deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 803c61fc..54f360d0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,8 @@ name: Deploy (development) run-name: Deploy ${{ inputs.stack }} with reset=${{ inputs.reset }} core=${{ inputs.core-image-tag }} country config=${{ inputs.countryconfig-image-tag }} on: + repository_dispatch: + types: [run_deploy] workflow_call: inputs: branch: From 5ff850a89417efbbef99dbc7b0adfb1ef00b9e26 Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Tue, 19 Nov 2024 16:39:13 +0200 Subject: [PATCH 06/10] feat: add actor name to run name --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 54f360d0..761489ef 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,5 @@ name: Deploy (development) -run-name: Deploy ${{ inputs.stack }} with reset=${{ inputs.reset }} core=${{ inputs.core-image-tag }} country config=${{ inputs.countryconfig-image-tag }} +run-name: Deploy by ${{ github.event.client_payload.actor || github.actor }} ${{ inputs.stack }} with reset=${{ inputs.reset }} core=${{ inputs.core-image-tag }} country config=${{ inputs.countryconfig-image-tag }} on: repository_dispatch: types: [run_deploy] From eceb96f5326c296222e01fa079e03a52513743cb Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Tue, 19 Nov 2024 16:50:10 +0200 Subject: [PATCH 07/10] fix: remove unnecessary branch value --- .github/workflows/deploy.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 761489ef..dbd45bf5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,14 +1,8 @@ name: Deploy (development) -run-name: Deploy by ${{ github.event.client_payload.actor || github.actor }} ${{ inputs.stack }} with reset=${{ inputs.reset }} core=${{ inputs.core-image-tag }} country config=${{ inputs.countryconfig-image-tag }} +run-name: 'Deploy by ${{ github.event.client_payload.actor || github.actor }} to ${{ github.event.client_payload.stack || github.event.inputs.stack }}. Images core: ${{ github.event.client_payload.core-image-tag || github.event.inputs.core-image-tag }} and farajaland: ${{ github.event.client_payload.countryconfig-image-tag || github.event.inputs.countryconfig-image-tag }}' on: - repository_dispatch: - types: [run_deploy] workflow_call: inputs: - branch: - description: 'The branch to checkout. Defaults to the branch triggering the workflow.' - required: false - type: string core-image-tag: type: string description: Core DockerHub image tag @@ -75,7 +69,6 @@ jobs: with: fetch-depth: 1 path: './${{ github.event.repository.name }}' - ref: ${{ inputs.branch || github.ref_name }} - name: Checkout country branch run: | From fc25e19a57e38f9117d2b4325383de43be0515bb Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Tue, 19 Nov 2024 18:11:40 +0200 Subject: [PATCH 08/10] fix: reset and seed-data never ran --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dbd45bf5..b73a90ec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -303,7 +303,7 @@ jobs: reset: needs: deploy - if: ${{ inputs.reset == 'true' && needs.deploy.outputs.outcome == 'success' }} + if: ${{ inputs.reset == 'true' && needs.deploy.outcome == 'success' }} uses: ./.github/workflows/clear-environment.yml with: environment: ${{ inputs.stack }} @@ -312,7 +312,7 @@ jobs: seed-data: needs: reset - if: ${{ inputs.reset == 'true' && needs.reset.outputs.outcome == 'success' }} + if: ${{ inputs.reset == 'true' && needs.reset.outcome == 'success' }} uses: ./.github/workflows/seed-data.yml with: environment: ${{ inputs.stack }} From 50398be4db72bc89c5555807604910ad332cc529 Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Tue, 19 Nov 2024 18:46:36 +0200 Subject: [PATCH 09/10] fix: the "needs" doesn't run if the previous wasn't successful --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b73a90ec..e8ffaea8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -303,7 +303,7 @@ jobs: reset: needs: deploy - if: ${{ inputs.reset == 'true' && needs.deploy.outcome == 'success' }} + if: ${{ inputs.reset == 'true' }} uses: ./.github/workflows/clear-environment.yml with: environment: ${{ inputs.stack }} @@ -312,7 +312,7 @@ jobs: seed-data: needs: reset - if: ${{ inputs.reset == 'true' && needs.reset.outcome == 'success' }} + if: ${{ inputs.reset == 'true' }} uses: ./.github/workflows/seed-data.yml with: environment: ${{ inputs.stack }} From 1ad6b85b54ac6d178b08d1f6fbfc6b40aa27cb7a Mon Sep 17 00:00:00 2001 From: Pyry Rouvila Date: Tue, 19 Nov 2024 18:55:52 +0200 Subject: [PATCH 10/10] fix: use boolean instead of string --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e8ffaea8..b7c00b00 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -303,7 +303,7 @@ jobs: reset: needs: deploy - if: ${{ inputs.reset == 'true' }} + if: inputs.reset == true uses: ./.github/workflows/clear-environment.yml with: environment: ${{ inputs.stack }} @@ -312,7 +312,7 @@ jobs: seed-data: needs: reset - if: ${{ inputs.reset == 'true' }} + if: inputs.reset == true uses: ./.github/workflows/seed-data.yml with: environment: ${{ inputs.stack }}