From 2235ec238cc7e9d16d1b831b20d60ec2ecabc4ed Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Tue, 12 Nov 2024 14:26:37 +0100 Subject: [PATCH 1/7] edited the env file --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index f98c69fb8..6cffc91c3 100644 --- a/.env.example +++ b/.env.example @@ -18,8 +18,8 @@ TREASURER_NAME= TREASURER_PHONE= AUTHORIZE_URL=/oauth/authorize -TOKEN_URL=/oauth/token -ME_URL=/oauth/me +TOKEN_URL=/api/v1/oauth/token +ME_URL=/api/v1/users?filter[me]&include="active_groups" COMPANY_NAME=Stichting Sociƫteit Flux COMPANY_IBAN=NL68 INGB 0008 1654 20 From 19d2fea7b4e7b2a6d5a1880c61970f250789fe66 Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Tue, 12 Nov 2024 15:04:11 +0100 Subject: [PATCH 2/7] fix CD --- .github/workflows/continuous-delivery.yml | 28 ++++++++++++++--------- app/views/partials/_footer.html.erb | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index 738ed981c..727de007e 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -4,9 +4,15 @@ on: workflow_dispatch: inputs: merge: - description: Merge staging into master first? (y/N) + type: boolean + description: Merge staging into master first? required: false - default: 'n' + default: false + ignore_metadata_diff: + type: boolean + description: Perform all jobs, regardless of whether there are actual changes? + required: false + default: false target_env: type: choice description: Target environment @@ -53,11 +59,11 @@ jobs: - name: Get metadata id: get_metadata env: - INPUT_MERGE: ${{ github.event.inputs.merge }} + INPUT_MERGE: ${{ inputs.merge }} TARGET_ENV: ${{ github.event.inputs.target_env }} run: | if [ "$GITHUB_REF_NAME" = 'master' ]; then - if [ "${INPUT_MERGE,,}" = 'y' ]; then + if [ "$INPUT_MERGE" = 'true' ]; then git fetch origin staging if ! git diff origin/master origin/staging --exit-code; then echo 'has_diff=true' >> "$GITHUB_OUTPUT" @@ -79,7 +85,7 @@ jobs: name: Merge runs-on: ubuntu-latest needs: metadata - if: github.event.inputs.merge == 'y' + if: inputs.merge outputs: sha: ${{ steps.get_sha.outputs.sha }} steps: @@ -101,7 +107,7 @@ jobs: uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Run merge - if: fromJSON(needs.metadata.outputs.has_diff) + if: fromJSON(needs.metadata.outputs.has_diff) || github.event.inputs.ignore_metadata_diff uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f # tag=v1.4.0 with: type: now @@ -111,7 +117,7 @@ jobs: - name: Get merge commit SHA id: get_sha - if: fromJSON(needs.metadata.outputs.has_diff) + if: fromJSON(needs.metadata.outputs.has_diff) || github.event.inputs.ignore_metadata_diff run: | git fetch origin master echo 'sha='"$(git rev-parse origin/master)" >> "$GITHUB_OUTPUT" @@ -119,7 +125,7 @@ jobs: continuous_integration: name: Continuous Integration needs: [metadata, merge] - if: fromJSON(needs.metadata.outputs.has_diff) + if: fromJSON(needs.metadata.outputs.has_diff) || github.event.inputs.ignore_metadata_diff uses: csvalpha/sofia/.github/workflows/continuous-integration.yml@staging with: sha: ${{ needs.merge.outputs.sha }} @@ -129,7 +135,7 @@ jobs: publish_image: name: Publish Image needs: [metadata, merge] - if: fromJSON(needs.metadata.outputs.has_diff) + if: fromJSON(needs.metadata.outputs.has_diff) || github.event.inputs.ignore_metadata_diff uses: csvalpha/sofia/.github/workflows/publish-image.yml@staging with: sha: ${{ needs.merge.outputs.sha }} @@ -143,8 +149,8 @@ jobs: needs: [metadata, merge, continuous_integration, publish_image] if: | (github.ref_name == 'staging' || github.ref_name == 'master') && ((github.ref_name == 'master' && - github.event.inputs.merge == 'y' && fromJSON(needs.metadata.outputs.has_diff) && success()) || - ((github.event.inputs.merge != 'y' || !fromJSON(needs.metadata.outputs.has_diff)) && !cancelled())) + inputs.merge && fromJSON(needs.metadata.outputs.has_diff) || github.event.inputs.ignore_metadata_diff && success()) || + ((!inputs.merge|| !fromJSON(needs.metadata.outputs.has_diff)) || github.event.inputs.ignore_metadata_diff && !cancelled())) steps: - name: Get environment URL id: get_url diff --git a/app/views/partials/_footer.html.erb b/app/views/partials/_footer.html.erb index 5e2ce47d4..feb462ab8 100644 --- a/app/views/partials/_footer.html.erb +++ b/app/views/partials/_footer.html.erb @@ -2,7 +2,7 @@ <% if Rails.application.config.x.tomato_host == 'stagingstreep.csvalpha.nl' %> For demo and testing purposes only - <% elsif Rails.application.config.x.tomato_host != 'streep.csvalpha.nl' %> + <% elsif Rails.application.config.x.tomato_host != 'streep.csvalpha.nl' && Rails.application.config.x.tomato_host != 'luxstreep.csvalpha.nl' %> Development mode <% end %> From 18058b6469ba3f671e3e7aa99f2c11d2878f0a23 Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Tue, 12 Nov 2024 15:07:44 +0100 Subject: [PATCH 3/7] added Codecov token --- .github/workflows/continuous-delivery.yml | 4 +++- .github/workflows/continuous-integration.yml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index 727de007e..19727b7c0 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -26,7 +26,7 @@ concurrency: env: PROJECT_NAME: sofia - +gi8t jobs: branch_check: name: Branch Check @@ -130,7 +130,9 @@ jobs: with: sha: ${{ needs.merge.outputs.sha }} secrets: + codecov_token: ${{ secrets.CODECOV_TOKEN }} rails_master_key: ${{ secrets.RAILS_MASTER_KEY }} + publish_image: name: Publish Image diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4510d3309..e6cd57f81 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -12,6 +12,9 @@ on: required: false type: string secrets: + codecov_token: + description: Codecov token + required: true rails_master_key: description: The Rails master key required: true From aa8f514ad876a1f985b80bb9b846ebfb29376836 Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Tue, 12 Nov 2024 15:10:48 +0100 Subject: [PATCH 4/7] fixes error --- .github/workflows/continuous-delivery.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index 19727b7c0..03a07e274 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -26,7 +26,7 @@ concurrency: env: PROJECT_NAME: sofia -gi8t + jobs: branch_check: name: Branch Check From b03ca0a27ac06bf5fc19baa64d8c61463abe8380 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Sun, 24 Nov 2024 21:49:45 +0100 Subject: [PATCH 5/7] remove docov token continuous-integration.yml --- .github/workflows/continuous-integration.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e6cd57f81..4510d3309 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -12,9 +12,6 @@ on: required: false type: string secrets: - codecov_token: - description: Codecov token - required: true rails_master_key: description: The Rails master key required: true From 4047666a3040d16fbcae32a5970be14205e10407 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Sun, 24 Nov 2024 21:50:55 +0100 Subject: [PATCH 6/7] removed codecov token continuous-delivery.yml --- .github/workflows/continuous-delivery.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index 03a07e274..b707b1d3b 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -130,7 +130,6 @@ jobs: with: sha: ${{ needs.merge.outputs.sha }} secrets: - codecov_token: ${{ secrets.CODECOV_TOKEN }} rails_master_key: ${{ secrets.RAILS_MASTER_KEY }} From 7f98fe514cabfd3ef3b132fb14d9cac4af5c7e32 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Sun, 24 Nov 2024 21:52:57 +0100 Subject: [PATCH 7/7] Update _footer.html.erb --- app/views/partials/_footer.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/partials/_footer.html.erb b/app/views/partials/_footer.html.erb index feb462ab8..5e2ce47d4 100644 --- a/app/views/partials/_footer.html.erb +++ b/app/views/partials/_footer.html.erb @@ -2,7 +2,7 @@ <% if Rails.application.config.x.tomato_host == 'stagingstreep.csvalpha.nl' %> For demo and testing purposes only - <% elsif Rails.application.config.x.tomato_host != 'streep.csvalpha.nl' && Rails.application.config.x.tomato_host != 'luxstreep.csvalpha.nl' %> + <% elsif Rails.application.config.x.tomato_host != 'streep.csvalpha.nl' %> Development mode <% end %>