From bb9bed9ae9a31d5d8e745deb7497f72038411ae0 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 8 Nov 2023 09:56:31 +0000 Subject: [PATCH 01/50] foo --- .github/workflows/dev.yaml | 9 ++ .../workflows/envmatrix-execute-command.yaml | 21 +++ .github/workflows/execute-command.yaml | 46 +++++++ .../workflows/p2p-workflow-definition.yaml | 122 ++++++++++++++++++ .gitignore | 1 + README.md | 1 + scratch/dev-dispatch.yaml | 15 +++ scratch/dev.yaml | 13 ++ scratch/p2p.yaml | 48 +++++++ 9 files changed, 276 insertions(+) create mode 100644 .github/workflows/dev.yaml create mode 100644 .github/workflows/envmatrix-execute-command.yaml create mode 100644 .github/workflows/execute-command.yaml create mode 100644 .github/workflows/p2p-workflow-definition.yaml create mode 100644 scratch/dev-dispatch.yaml create mode 100644 scratch/dev.yaml create mode 100644 scratch/p2p.yaml diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml new file mode 100644 index 0000000..3712135 --- /dev/null +++ b/.github/workflows/dev.yaml @@ -0,0 +1,9 @@ + +on: + workflow_dispatch: null + pull_request: + types: [opened, synchronize, labeled, unlabeled] + +jobs: + p2p: + uses: ./.github/workflows/p2p-workflow-definition.yaml diff --git a/.github/workflows/envmatrix-execute-command.yaml b/.github/workflows/envmatrix-execute-command.yaml new file mode 100644 index 0000000..d62154a --- /dev/null +++ b/.github/workflows/envmatrix-execute-command.yaml @@ -0,0 +1,21 @@ +on: + workflow_call: + inputs: + command: + required: true + type: string + envmatrix: + required: true + type: string + + +jobs: + env: + strategy: + matrix: ${{ fromJSON(inputs.envmatrix) }} + fail-fast: false + uses: ./.github/workflows/execute-command.yaml + with: + command: ${{ inputs.command }} + github_env: ${{ matrix.deploy_env }} + diff --git a/.github/workflows/execute-command.yaml b/.github/workflows/execute-command.yaml new file mode 100644 index 0000000..24a0e68 --- /dev/null +++ b/.github/workflows/execute-command.yaml @@ -0,0 +1,46 @@ +on: + workflow_call: + inputs: + command: + required: true + type: string + github_env: + required: false + type: string + default: '' + + +jobs: + exec: + name: ${{ inputs.command }}-${{ inputs.github_env }} + runs-on: ubuntu-latest + environment: ${{ inputs.github_env }} + env: + REGISTRY: ${{ vars.REGION }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant + SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com + WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} + BASE_URL: ${{ vars.BASE_URL }} + ENVIRONMENT: ${{ vars.ENV }} + ENV: ${{ vars.ENV }} + PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} + PROJECT_ID: ${{ vars.PROJECT_ID }} + TENANT_NAME: ${{ vars.TENANT_NAME }} + ADDITIONAL_ENV_VARS: "FOO,BAR" + steps: + - name: add_additional_env_vars + env: + ALL_VARS: ${{ toJSON(vars) }}" + run: | + echo "ALL_VARS=$ALL_VARS" + - name: print + run: | + echo "BASE_URL=$BASE_URL" + echo "PROJECT_ID=$PROJECT_ID" + echo "REGION=$REGION" + echo "SERVICE_ACCOUNT=$SERVICE_ACCOUNT" + echo "WORKLOAD_IDENTITY_PROVIDER=$WORKLOAD_IDENTITY_PROVIDER" + echo "REGISTRY=$REGISTRY" + echo "PROJECT_NUMBER=$PROJECT_NUMBER" + echo "TENANT_NAME=$TENANT_NAME" + echo "ENV=$ENVIRONMENT" + diff --git a/.github/workflows/p2p-workflow-definition.yaml b/.github/workflows/p2p-workflow-definition.yaml new file mode 100644 index 0000000..5594113 --- /dev/null +++ b/.github/workflows/p2p-workflow-definition.yaml @@ -0,0 +1,122 @@ +name: Developer Platform P2P + + +on: + workflow_call: + secrets: + env_vars: + required: false + inputs: + dry-run: + required: false + type: boolean + default: false + pre-targets: + description: | + Make targets to run before each p2p command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after each p2p command + required: false + type: string + default: '' + +env: + REGION: europe-west2 + +jobs: +# setup: +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: ${{ fromJson(vars.STAGE_DEV) }} +# environment: "${{ matrix.deploy_env }}" +# env: +# REGISTRY: ${{ vars.REGION }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant +# SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com +# WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} +# BASE_URL: ${{ vars.BASE_URL }} +# ENVIRONMENT: ${{ vars.ENV }} +# ENV: ${{ vars.ENV }} +# PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} +# PROJECT_ID: ${{ vars.PROJECT_ID }} +# TENANT_NAME: ${{ vars.TENANT_NAME }} +# outputs: +# workflow_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} +# service_account: ${{ env.SERVICE_ACCOUNT }} +# deploy-env: ${{ inputs.deploy-env }} +# region: ${{ vars.REGION }} +# project-id: ${{ vars.PROJECT_ID }} +# base-url: ${{ vars.BASE_URL }} +# env_vars: ${{ toJSON(env) }} +# env-name: ${{ vars.ENV }} +# matrix: ${{ toJSON(matrix) }} +# steps: +# - name: Setup inputs passed to the reusable workflow +# id: setup +# run: | +# echo "workflow_identity_provider=$WORKLOAD_IDENTITY_PROVIDER" +# echo "service_account=$SERVICE_ACCOUNT" + +# print: +# runs-on: ubuntu-latest +# needs: setup +# steps: +# - name: print +# id: print +# run: | +# echo "deploy_env=${{ needs.setup.outputs.deploy-env }}" +# echo "project_id=${{ needs.setup.outputs.project-id }}" +# echo "project_number=${{ needs.setup.outputs.project-number }}" +# echo "base_url=${{ needs.setup.outputs.base-url }}" +# echo "workflow_identity_provider=${{ needs.setup.outputs.workflow_identity_provider }}" +# echo "env=${{ needs.setup.outputs.env-name }}" +# echo "service_account=${{ needs.setup.outputs.service_account }}" +# echo "registry=${{ needs.setup.outputs.registry }}" +# echo "env_vars=${{ needs.setup.outputs.env_vars }}" +# echo "matrix=${{ needs.setup.outputs.matrix }}" +# echo "matrix=${{ needs.setup.outputs.envvars_cecg-sandbox }}" + + + build: + uses: ./.github/workflows/envmatrix-execute-command.yaml + with: + command: build + envmatrix: ${{ vars.STAGE_DEV }} + + functional-test: + needs: [build] + uses: ./.github/workflows/envmatrix-execute-command.yaml + with: + command: func + envmatrix: ${{ vars.STAGE_DEV }} + + + prod-deploy: + needs: [build] + uses: ./.github/workflows/envmatrix-execute-command.yaml + with: + command: prod + envmatrix: ${{ vars.STAGE_PROD }} +# +# +# nft-test: +# name: nft-test +# needs: [functional-test, setup] +# uses: ./.github/workflows/execute-command.yaml +# with: +# command: p2p-nft +# foo: ${{ needs.setup.outputs.env_vars }} +# +# dev-deploy: +# name: dev-deploy +# #if: github.ref == 'refs/heads/main' +# needs: [nft-test, setup] +# uses: ./.github/workflows/execute-command.yaml +# with: +# command: p2p-dev +# foo: ${{ needs.setup.outputs.env_vars }} + diff --git a/.gitignore b/.gitignore index d87d4be..519ddf8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.gem +.history/ *.rbc .bundle .config diff --git a/README.md b/README.md index 6347553..8ab0fb4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Logstuff + Logstuff is a rubygem for writing application logs in a more structured form. It will output the logs in JSON format to allow collection from logstash/beaver diff --git a/scratch/dev-dispatch.yaml b/scratch/dev-dispatch.yaml new file mode 100644 index 0000000..5032ac5 --- /dev/null +++ b/scratch/dev-dispatch.yaml @@ -0,0 +1,15 @@ + +on: + workflow_dispatch: + inputs: + deploy_env: + description: "Environment to deploy" + +env: + REGION: europe-west1 + +jobs: + deploy_to_dev: + uses: ./.github/workflows/p2p.yaml + with: + deploy-env: ${{ inputs.deploy_env }} diff --git a/scratch/dev.yaml b/scratch/dev.yaml new file mode 100644 index 0000000..56df64d --- /dev/null +++ b/scratch/dev.yaml @@ -0,0 +1,13 @@ + + +on: + workflow_dispatch: null + pull_request: + types: [opened, synchronize, labeled, unlabeled] + +env: + REGION: europe-west1 + +jobs: + p2p: + uses: ./.github/workflows/p2p.yaml diff --git a/scratch/p2p.yaml b/scratch/p2p.yaml new file mode 100644 index 0000000..3af38b6 --- /dev/null +++ b/scratch/p2p.yaml @@ -0,0 +1,48 @@ +name: Developer Platform P2P + +on: + workflow_call: + inputs: + deploy-env: + required: true + type: string + + + +jobs: + setup: + runs-on: ubuntu-latest + environment: ${{ inputs.deploy-env }} + env: + REGISTRY: ${{ vars.REGION }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant + SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com + WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} + outputs: + workflow_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ vars.SERVICE_ACCOUNT }} + deploy_env: ${{ inputs.deploy-env }} + region: ${{ vars.REGION }} + project_id: ${{ vars.PROJECT_ID }} + project_number: ${{ vars.PROJECT_NUMBER }} + tenant_name: ${{ vars.TENANT_NAME }} + base_url: ${{ vars.BASE_URL }} + env: ${{ vars.ENV }} + + steps: + - name: Setup inputs passed to the reusable workflow + id: setup + run: | + echo "workflow_identity_provider=$WORKLOAD_IDENTITY_PROVIDER" + echo "service_account=$SERVICE_ACCOUNT" + + print: + runs-on: ubuntu-latest + needs: setup + steps: + - name: print + id: print + run: | + echo "deploy_env=${{ needs.setup.outputs.deploy_env }}" + echo "project_id=${{ needs.setup.outputs.project_id }}" + echo "project_number=${{ needs.setup.outputs.project_number }}" + echo "base_url=${{ needs.setup.outputs.base_url }}" From 2164dba492f8571e1ce5a45729615fa86fbc4054 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Mon, 27 Nov 2023 20:40:32 +0000 Subject: [PATCH 02/50] see what pops - 20:40:32 --- .github/workflows/p2p-workflow-definition.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/p2p-workflow-definition.yaml b/.github/workflows/p2p-workflow-definition.yaml index 5594113..f5af52b 100644 --- a/.github/workflows/p2p-workflow-definition.yaml +++ b/.github/workflows/p2p-workflow-definition.yaml @@ -79,7 +79,6 @@ jobs: # echo "env_vars=${{ needs.setup.outputs.env_vars }}" # echo "matrix=${{ needs.setup.outputs.matrix }}" # echo "matrix=${{ needs.setup.outputs.envvars_cecg-sandbox }}" - build: uses: ./.github/workflows/envmatrix-execute-command.yaml From 13d12c6ec1e4faaad4632191a46ae4cbc5e1e93e Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Mon, 27 Nov 2023 20:44:55 +0000 Subject: [PATCH 03/50] see what pops - 20:44:55 --- .github/workflows/p2p-workflow-definition.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/p2p-workflow-definition.yaml b/.github/workflows/p2p-workflow-definition.yaml index f5af52b..09190bc 100644 --- a/.github/workflows/p2p-workflow-definition.yaml +++ b/.github/workflows/p2p-workflow-definition.yaml @@ -95,7 +95,7 @@ jobs: prod-deploy: - needs: [build] + needs: [build,functional-test] uses: ./.github/workflows/envmatrix-execute-command.yaml with: command: prod From cbb564475c57d087babc865209698a41e2b8651c Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Tue, 28 Nov 2023 10:28:18 +0000 Subject: [PATCH 04/50] see what pops - 10:28:18 --- .github/workflows/execute-command.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/execute-command.yaml b/.github/workflows/execute-command.yaml index 24a0e68..8f55bd6 100644 --- a/.github/workflows/execute-command.yaml +++ b/.github/workflows/execute-command.yaml @@ -12,7 +12,7 @@ on: jobs: exec: - name: ${{ inputs.command }}-${{ inputs.github_env }} + name: '${{ inputs.command }} (${{ inputs.github_env }})' runs-on: ubuntu-latest environment: ${{ inputs.github_env }} env: From da814a3a2485003e51bfb6ad032941daffb7b3ea Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 10:16:11 +0000 Subject: [PATCH 05/50] quick-commit - Wed 11/29/2023 10:16:11 --- .github/workflows/dev.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 3712135..880c373 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -5,5 +5,9 @@ on: types: [opened, synchronize, labeled, unlabeled] jobs: - p2p: + fastfeedback: uses: ./.github/workflows/p2p-workflow-definition.yaml + extendedtests: + uses: ./.github/workflows/p2p-workflow-definition.yaml + prod: + uses: ./.github/workflows/p2p-workflow-definition.yaml \ No newline at end of file From fbaf1d3587fa4e40783c278e998365f4bdc04d95 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 16:36:03 +0000 Subject: [PATCH 06/50] quick-commit - Wed 11/29/2023 16:36:03 --- .github/workflows/cd.yaml | 21 +++ .github/workflows/dev-dispatch.yaml | 15 -- .github/workflows/dev.yaml | 13 -- .../workflows/envmatrix-execute-command.yaml | 10 ++ .github/workflows/execute-command.yaml | 40 ++++- .github/workflows/external-promote-image.yaml | 166 ++++++++++++++++++ .../workflows/external-workflow-exttests.yaml | 78 ++++++++ .../external-workflow-fastfeedback.yaml | 106 +++++++++++ .github/workflows/external-workflow-prod.yaml | 46 +++++ .github/workflows/p2p-dispatch.yaml | 25 +++ .../workflows/p2p-workflow-definition.yaml | 121 ------------- .github/workflows/p2p.yaml | 48 ----- scratch/dev.yaml | 12 +- 13 files changed, 496 insertions(+), 205 deletions(-) create mode 100644 .github/workflows/cd.yaml delete mode 100644 .github/workflows/dev-dispatch.yaml delete mode 100644 .github/workflows/dev.yaml create mode 100644 .github/workflows/external-promote-image.yaml create mode 100644 .github/workflows/external-workflow-exttests.yaml create mode 100644 .github/workflows/external-workflow-fastfeedback.yaml create mode 100644 .github/workflows/external-workflow-prod.yaml create mode 100644 .github/workflows/p2p-dispatch.yaml delete mode 100644 .github/workflows/p2p-workflow-definition.yaml delete mode 100644 .github/workflows/p2p.yaml diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..602611c --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,21 @@ + +on: + pull_request: + types: [opened, synchronize, labeled, unlabeled] + +permissions: + contents: read + id-token: write + +jobs: + fastfeedback: + uses: ./.github/workflows/external-workflow-fastfeedback.yaml + + extendedtests: + uses: ./.github/workflows/external-workflow-exttests.yaml + needs: [fastfeedback] + with: + tag: ${{ needs.fastfeedback.outputs.tag }} + semver: ${{ needs.fastfeedback.outputs.semver }} +# prod: +# uses: ./.github/workflows/external-workflow-prod.yaml \ No newline at end of file diff --git a/.github/workflows/dev-dispatch.yaml b/.github/workflows/dev-dispatch.yaml deleted file mode 100644 index 5032ac5..0000000 --- a/.github/workflows/dev-dispatch.yaml +++ /dev/null @@ -1,15 +0,0 @@ - -on: - workflow_dispatch: - inputs: - deploy_env: - description: "Environment to deploy" - -env: - REGION: europe-west1 - -jobs: - deploy_to_dev: - uses: ./.github/workflows/p2p.yaml - with: - deploy-env: ${{ inputs.deploy_env }} diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml deleted file mode 100644 index 880c373..0000000 --- a/.github/workflows/dev.yaml +++ /dev/null @@ -1,13 +0,0 @@ - -on: - workflow_dispatch: null - pull_request: - types: [opened, synchronize, labeled, unlabeled] - -jobs: - fastfeedback: - uses: ./.github/workflows/p2p-workflow-definition.yaml - extendedtests: - uses: ./.github/workflows/p2p-workflow-definition.yaml - prod: - uses: ./.github/workflows/p2p-workflow-definition.yaml \ No newline at end of file diff --git a/.github/workflows/envmatrix-execute-command.yaml b/.github/workflows/envmatrix-execute-command.yaml index d62154a..f1ea8ac 100644 --- a/.github/workflows/envmatrix-execute-command.yaml +++ b/.github/workflows/envmatrix-execute-command.yaml @@ -7,6 +7,14 @@ on: envmatrix: required: true type: string + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' jobs: @@ -18,4 +26,6 @@ jobs: with: command: ${{ inputs.command }} github_env: ${{ matrix.deploy_env }} + tag: ${{ inputs.tag }} + semver: ${{ inputs.semver }} diff --git a/.github/workflows/execute-command.yaml b/.github/workflows/execute-command.yaml index 8f55bd6..be35d07 100644 --- a/.github/workflows/execute-command.yaml +++ b/.github/workflows/execute-command.yaml @@ -8,6 +8,38 @@ on: required: false type: string default: '' + dry-run: + required: false + type: boolean + default: false + region: + required: false + type: string + default: europe-west2 + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + zone: + required: false + type: string + default: europe-west2-a + pre-targets: + description: | + Make targets to run before the command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after the command + required: false + type: string + default: '' jobs: @@ -16,7 +48,10 @@ jobs: runs-on: ubuntu-latest environment: ${{ inputs.github_env }} env: - REGISTRY: ${{ vars.REGION }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant + TAG_VERSION: ${{ inputs.tag }} + SEMVER: ${{ inputs.semver }} + REGION: ${{ inputs.region }} + REGISTRY: ${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} BASE_URL: ${{ vars.BASE_URL }} @@ -34,6 +69,8 @@ jobs: echo "ALL_VARS=$ALL_VARS" - name: print run: | + echo "TAG_VERSION=$TAG_VERSION" + echo "SEMVER=$SEMVER" echo "BASE_URL=$BASE_URL" echo "PROJECT_ID=$PROJECT_ID" echo "REGION=$REGION" @@ -43,4 +80,3 @@ jobs: echo "PROJECT_NUMBER=$PROJECT_NUMBER" echo "TENANT_NAME=$TENANT_NAME" echo "ENV=$ENVIRONMENT" - diff --git a/.github/workflows/external-promote-image.yaml b/.github/workflows/external-promote-image.yaml new file mode 100644 index 0000000..47e09c0 --- /dev/null +++ b/.github/workflows/external-promote-image.yaml @@ -0,0 +1,166 @@ +name: p2p-command + +on: + workflow_call: + secrets: + env_vars: + required: false + inputs: + promotion-stage: + required: true + type: string + dry-run: + required: false + type: boolean + default: false + source_github_env: + required: true + type: string + dest_github_env: + required: true + type: string + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + region: + required: false + type: string + default: europe-west2 + pre-targets: + description: | + Make targets to run before the command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after the command + required: false + type: string + default: '' + + +jobs: + lookup: + runs-on: ubuntu-latest + environment: ${{ inputs.source_github_env }} + env: + REGISTRY: ${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant + SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com + WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} + outputs: + source_registry: ${{ env.REGISTRY }} + source_service_account: ${{ env.SERVICE_ACCOUNT }} + source_workflow_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} + steps: + - run: echo "dummy command" + + promote-image: + name: promote-${{ inputs.promotion-stage }} + runs-on: ubuntu-latest + needs: [lookup] + environment: ${{ inputs.dest_github_env }} + env: + TAG_VERSION: ${{ inputs.tag }} + SEMVER: ${{ inputs.semver }} + SOURCE_REGISTRY: ${{ needs.lookup.outputs.source_registry }} + SOURCE_SERVICE_ACCOUNT: ${{ needs.lookup.outputs.source_service_account }} + SOURCE_WORKLOAD_IDENTITY_PROVIDER: ${{ needs.lookup.outputs.source_workflow_identity_provider }} + + REGION: ${{ inputs.region }} + REGISTRY: ${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant + SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com + WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} + BASE_URL: ${{ vars.BASE_URL }} + ENVIRONMENT: ${{ vars.ENV }} + ENV: ${{ vars.ENV }} + PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} + PROJECT_ID: ${{ vars.PROJECT_ID }} + TENANT_NAME: ${{ vars.TENANT_NAME }} + ADDITIONAL_ENV_VARS: "FOO,BAR" + permissions: + contents: read + id-token: write + + steps: + - name: print + run: | + echo "SOURCE_GITHUB_ENV=${{ inputs.source_github_env }}" + echo "DEST_GITHUB_ENV=${{ inputs.dest_github_env }}" + echo "SOURCE_REGISTRY=$SOURCE_REGISTRY" + echo "SOURCE_SERVICE_ACCOUNT=$SOURCE_SERVICE_ACCOUNT" + echo "SOURCE_WORKLOAD_IDENTITY_PROVIDER=$SOURCE_WORKLOAD_IDENTITY_PROVIDER" + echo "BASE_URL=$BASE_URL" + echo "PROJECT_ID=$PROJECT_ID" + echo "REGION=$REGION" + echo "SERVICE_ACCOUNT=$SERVICE_ACCOUNT" + echo "WORKLOAD_IDENTITY_PROVIDER=$WORKLOAD_IDENTITY_PROVIDER" + echo "REGISTRY=$REGISTRY" + echo "PROJECT_NUMBER=$PROJECT_NUMBER" + echo "TENANT_NAME=$TENANT_NAME" + echo "ENV=$ENVIRONMENT" + echo "TAG_VERSION=$TAG_VERSION" + + - name: Checkout + uses: actions/checkout@v3 + + - name: Authenticate to Google Cloud (Source) + id: auth-dev + if: inputs.dry-run == false + uses: google-github-actions/auth@v1 + with: + workload_identity_provider: ${{ env.SOURCE_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ env.SOURCE_SERVICE_ACCOUNT }} + token_format: access_token + access_token_lifetime: 600s + + - name: Login to Artifact Registry + uses: docker/login-action@v2 + if: inputs.dry-run == false + with: + registry: europe-west2-docker.pkg.dev + username: oauth2accesstoken + password: ${{ steps.auth-dev.outputs.access_token }} + + - name: Check if prepare promotion task exists + id: run-check-prepare-promotion + run: | + make + echo "prepare_promotion_task=$(make | grep -E 'p2p-prepare-promotion-${{ inputs.promotion-stage }}')" >> $GITHUB_OUTPUT + cat $GITHUB_OUTPUT + + - name: Run Prepare Promotion + if: steps.run-check-prepare-promotion.outputs.prepare_promotion_task != '' + id: run-prepare-promotion + run: | + make p2p-prepare-promotion-${{ inputs.promotion-stage }} + + + - name: Authenticate to Google Cloud (Dest)) + id: auth-prod + if: inputs.dry-run == false && inputs.promotion-stage == 'prod' + uses: google-github-actions/auth@v1 + with: + workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ env.SERVICE_ACCOUNT }} + token_format: access_token + access_token_lifetime: 600s + + - name: Login to Artifact Registry Prod + uses: docker/login-action@v2 + if: inputs.dry-run == false && inputs.promotion-stage == 'prod' + with: + registry: europe-west2-docker.pkg.dev + username: oauth2accesstoken + password: ${{ steps.auth-prod.outputs.access_token }} + + - name: Run Promotion + id: run-promotion + run: | + make p2p-promote-${{ inputs.promotion-stage }} + \ No newline at end of file diff --git a/.github/workflows/external-workflow-exttests.yaml b/.github/workflows/external-workflow-exttests.yaml new file mode 100644 index 0000000..1518d30 --- /dev/null +++ b/.github/workflows/external-workflow-exttests.yaml @@ -0,0 +1,78 @@ + +on: + workflow_call: + inputs: + stage-dev: + required: false + type: string + default: ${{ vars.STAGE_DEV }} + dry-run: + required: false + type: boolean + default: false + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + pre-targets: + description: | + Make targets to run before each p2p command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after each p2p command + required: false + type: string + default: '' + +env: + REGION: europe-west2 + +jobs: + promote-pre-extended-tests: + name: promote-extended-tests + #if: github.ref == 'refs/heads/main' + uses: ./.github/workflows/external-promote-image.yaml + with: + source_github_env: ${{ vars.PRIMARY_DEV }} + dest_github_env: ${{ vars.PRIMARY_PROD }} + promotion-stage: extended-tests + tag: ${{ inputs.tag }} + semver: ${{ inputs.semver }} + + + run-tests: + uses: ./.github/workflows/envmatrix-execute-command.yaml + needs: [promote-pre-extended-tests] + with: + command: p2p-extended-tests + envmatrix: ${{ vars.STAGE_DEV }} + tag: ${{ inputs.tag }} + semver: ${{ inputs.semver }} + + dev-deploy: + name: dev-deploy + #if: github.ref == 'refs/heads/main' + needs: [run-tests] + uses: ./.github/workflows/envmatrix-execute-command.yaml + with: + command: p2p-dev + envmatrix: ${{ inputs.stage-dev }} + tag: ${{ needs.version.outputs.image_tag }} + semver: ${{ needs.version.outputs.semver }} + + promote-post-extended-tests: + uses: ./.github/workflows/external-promote-image.yaml + needs: [run-tests] + with: + source_github_env: ${{ vars.PRIMARY_DEV }} + dest_github_env: ${{ vars.PRIMARY_PROD }} + promotion-stage: prod + tag: ${{ inputs.tag }} + semver: ${{ inputs.semver }} diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml new file mode 100644 index 0000000..dbf1d03 --- /dev/null +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -0,0 +1,106 @@ + +on: + workflow_call: + inputs: + stage-dev: + required: false + type: string + default: ${{ vars.STAGE_DEV }} + dry-run: + required: false + type: boolean + default: false + pre-targets: + description: | + Make targets to run before each p2p command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after each p2p command + required: false + type: string + default: '' + outputs: + image_tag: + value: ${{ jobs.version.outputs.image_tag }} + semver: + value: ${{ jobs.version.outputs.semver }} + +env: + REGION: europe-west2 + +jobs: + version: + runs-on: ubuntu-latest + env: + USE_SEMVER_AS_IMAGE_TAG: true + outputs: + image_tag: ${{ steps.version.outputs.image_tag }} + semver: ${{ steps.version.outputs.semver }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # fetch-tags is currently broken so we need fetch them manually in the + # next step + fetch-tags: true + + - name: Get version + id: version + shell: bash + run: | + git fetch --prune --unshallow --tags + DESCRIBE="$(git describe --match 'prefix_*' --abbrev=7)" + CLEANED_DESCRIBE="$(echo $DESCRIBE | tr '-' '.')" + IMAGE_TAG="$(echo $DESCRIBE | sed 's/prefix_/v/')" + SEMVER="${CLEANED_DESCRIBE:7:-9}" + echo "DESCRIBE=$DESCRIBE CLEANED_DESCRIBE=$CLEANED_DESCRIBE" + echo "IMAGE_TAG=$IMAGE_TAG SEMVER=$SEMVER" + echo "semver=$SEMVER" >> $GITHUB_OUTPUT + if [[ "$USE_SEMVER_AS_IMAGE_TAG" == "true" ]]; then + echo "image_tag=$SEMVER" >> $GITHUB_OUTPUT + else + echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT + fi + + build: + needs: [version] + uses: ./.github/workflows/envmatrix-execute-command.yaml + strategy: + matrix: ${{ fromJSON(inputs.stage-dev) }} + fail-fast: false + with: + command: p2p-build + github_env: ${{ matrix.deploy_env }} + tag: ${{ needs.version.outputs.image_tag }} + semver: ${{ needs.version.outputs.semver }} + + functional-test: + needs: [version, build] + uses: ./.github/workflows/envmatrix-execute-command.yaml + strategy: + matrix: ${{ fromJSON(inputs.stage-dev) }} + fail-fast: false + with: + command: p2p-functional + github_env: ${{ matrix.deploy_env }} + tag: ${{ needs.version.outputs.image_tag }} + semver: ${{ needs.version.outputs.semver }} + + + nft-test: + needs: [version, functional-test] + uses: ./.github/workflows/envmatrix-execute-command.yaml + strategy: + matrix: ${{ fromJSON(inputs.stage-dev) }} + fail-fast: false + with: + command: p2p-nft + github_env: ${{ matrix.deploy_env }} + tag: ${{ needs.version.outputs.image_tag }} + semver: ${{ needs.version.outputs.semver }} + + + diff --git a/.github/workflows/external-workflow-prod.yaml b/.github/workflows/external-workflow-prod.yaml new file mode 100644 index 0000000..5b594a3 --- /dev/null +++ b/.github/workflows/external-workflow-prod.yaml @@ -0,0 +1,46 @@ + +on: + workflow_call: + secrets: + env_vars: + required: false + inputs: + stage-prod: + required: false + type: string + default: ${{ vars.STAGE_PROD }} + dry-run: + required: false + type: boolean + default: false + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + pre-targets: + description: | + Make targets to run before each p2p command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after each p2p command + required: false + type: string + default: '' + +jobs: + prod-deploy: + name: prod-deploy + #if: github.ref == 'refs/heads/main' + uses: ./.github/workflows/envmatrix-execute-command.yaml + with: + command: p2p-prod + envmatrix: ${{ inputs.stage-prod }} + + diff --git a/.github/workflows/p2p-dispatch.yaml b/.github/workflows/p2p-dispatch.yaml new file mode 100644 index 0000000..9cffc31 --- /dev/null +++ b/.github/workflows/p2p-dispatch.yaml @@ -0,0 +1,25 @@ + +on: + workflow_dispatch: + inputs: + stage-dev: + required: true + type: string + runsteps: + required: false + type: string + default: 'fastfeedback,extendedtests,prod' +permissions: + contents: read + id-token: write + +jobs: + fastfeedback: + if: contains(github.event.inputs.runsteps, 'fastfeedback') + uses: ./.github/workflows/external-workflow-fastfeedback.yaml +# extendedtests: +# uses: ./.github/workflows/p2p-workflow-definition.yaml +# if: contains(github.event.inputs.runsteps, 'extendedtests') +# prod: +# uses: ./.github/workflows/p2p-workflow-definition.yaml +# if: contains(github.event.inputs.runsteps, 'extendedtests') diff --git a/.github/workflows/p2p-workflow-definition.yaml b/.github/workflows/p2p-workflow-definition.yaml deleted file mode 100644 index 09190bc..0000000 --- a/.github/workflows/p2p-workflow-definition.yaml +++ /dev/null @@ -1,121 +0,0 @@ -name: Developer Platform P2P - - -on: - workflow_call: - secrets: - env_vars: - required: false - inputs: - dry-run: - required: false - type: boolean - default: false - pre-targets: - description: | - Make targets to run before each p2p command - required: false - type: string - default: '' - post-targets: - description: | - Make targets to run after each p2p command - required: false - type: string - default: '' - -env: - REGION: europe-west2 - -jobs: -# setup: -# runs-on: ubuntu-latest -# strategy: -# fail-fast: false -# matrix: ${{ fromJson(vars.STAGE_DEV) }} -# environment: "${{ matrix.deploy_env }}" -# env: -# REGISTRY: ${{ vars.REGION }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant -# SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com -# WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} -# BASE_URL: ${{ vars.BASE_URL }} -# ENVIRONMENT: ${{ vars.ENV }} -# ENV: ${{ vars.ENV }} -# PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} -# PROJECT_ID: ${{ vars.PROJECT_ID }} -# TENANT_NAME: ${{ vars.TENANT_NAME }} -# outputs: -# workflow_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} -# service_account: ${{ env.SERVICE_ACCOUNT }} -# deploy-env: ${{ inputs.deploy-env }} -# region: ${{ vars.REGION }} -# project-id: ${{ vars.PROJECT_ID }} -# base-url: ${{ vars.BASE_URL }} -# env_vars: ${{ toJSON(env) }} -# env-name: ${{ vars.ENV }} -# matrix: ${{ toJSON(matrix) }} -# steps: -# - name: Setup inputs passed to the reusable workflow -# id: setup -# run: | -# echo "workflow_identity_provider=$WORKLOAD_IDENTITY_PROVIDER" -# echo "service_account=$SERVICE_ACCOUNT" - -# print: -# runs-on: ubuntu-latest -# needs: setup -# steps: -# - name: print -# id: print -# run: | -# echo "deploy_env=${{ needs.setup.outputs.deploy-env }}" -# echo "project_id=${{ needs.setup.outputs.project-id }}" -# echo "project_number=${{ needs.setup.outputs.project-number }}" -# echo "base_url=${{ needs.setup.outputs.base-url }}" -# echo "workflow_identity_provider=${{ needs.setup.outputs.workflow_identity_provider }}" -# echo "env=${{ needs.setup.outputs.env-name }}" -# echo "service_account=${{ needs.setup.outputs.service_account }}" -# echo "registry=${{ needs.setup.outputs.registry }}" -# echo "env_vars=${{ needs.setup.outputs.env_vars }}" -# echo "matrix=${{ needs.setup.outputs.matrix }}" -# echo "matrix=${{ needs.setup.outputs.envvars_cecg-sandbox }}" - - build: - uses: ./.github/workflows/envmatrix-execute-command.yaml - with: - command: build - envmatrix: ${{ vars.STAGE_DEV }} - - functional-test: - needs: [build] - uses: ./.github/workflows/envmatrix-execute-command.yaml - with: - command: func - envmatrix: ${{ vars.STAGE_DEV }} - - - prod-deploy: - needs: [build,functional-test] - uses: ./.github/workflows/envmatrix-execute-command.yaml - with: - command: prod - envmatrix: ${{ vars.STAGE_PROD }} -# -# -# nft-test: -# name: nft-test -# needs: [functional-test, setup] -# uses: ./.github/workflows/execute-command.yaml -# with: -# command: p2p-nft -# foo: ${{ needs.setup.outputs.env_vars }} -# -# dev-deploy: -# name: dev-deploy -# #if: github.ref == 'refs/heads/main' -# needs: [nft-test, setup] -# uses: ./.github/workflows/execute-command.yaml -# with: -# command: p2p-dev -# foo: ${{ needs.setup.outputs.env_vars }} - diff --git a/.github/workflows/p2p.yaml b/.github/workflows/p2p.yaml deleted file mode 100644 index 3af38b6..0000000 --- a/.github/workflows/p2p.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Developer Platform P2P - -on: - workflow_call: - inputs: - deploy-env: - required: true - type: string - - - -jobs: - setup: - runs-on: ubuntu-latest - environment: ${{ inputs.deploy-env }} - env: - REGISTRY: ${{ vars.REGION }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant - SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com - WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} - outputs: - workflow_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER }} - service_account: ${{ vars.SERVICE_ACCOUNT }} - deploy_env: ${{ inputs.deploy-env }} - region: ${{ vars.REGION }} - project_id: ${{ vars.PROJECT_ID }} - project_number: ${{ vars.PROJECT_NUMBER }} - tenant_name: ${{ vars.TENANT_NAME }} - base_url: ${{ vars.BASE_URL }} - env: ${{ vars.ENV }} - - steps: - - name: Setup inputs passed to the reusable workflow - id: setup - run: | - echo "workflow_identity_provider=$WORKLOAD_IDENTITY_PROVIDER" - echo "service_account=$SERVICE_ACCOUNT" - - print: - runs-on: ubuntu-latest - needs: setup - steps: - - name: print - id: print - run: | - echo "deploy_env=${{ needs.setup.outputs.deploy_env }}" - echo "project_id=${{ needs.setup.outputs.project_id }}" - echo "project_number=${{ needs.setup.outputs.project_number }}" - echo "base_url=${{ needs.setup.outputs.base_url }}" diff --git a/scratch/dev.yaml b/scratch/dev.yaml index 56df64d..880c373 100644 --- a/scratch/dev.yaml +++ b/scratch/dev.yaml @@ -1,13 +1,13 @@ - on: workflow_dispatch: null pull_request: types: [opened, synchronize, labeled, unlabeled] -env: - REGION: europe-west1 - jobs: - p2p: - uses: ./.github/workflows/p2p.yaml + fastfeedback: + uses: ./.github/workflows/p2p-workflow-definition.yaml + extendedtests: + uses: ./.github/workflows/p2p-workflow-definition.yaml + prod: + uses: ./.github/workflows/p2p-workflow-definition.yaml \ No newline at end of file From b7de364b4c1456c927a8219787e5a03fdf1728a0 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 16:41:29 +0000 Subject: [PATCH 07/50] quick-commit - Wed 11/29/2023 16:41:28 --- .github/workflows/cd.yaml | 2 +- .github/workflows/external-workflow-exttests.yaml | 10 +++++----- .../workflows/external-workflow-fastfeedback.yaml | 15 +++------------ 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 602611c..c5aae59 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -15,7 +15,7 @@ jobs: uses: ./.github/workflows/external-workflow-exttests.yaml needs: [fastfeedback] with: - tag: ${{ needs.fastfeedback.outputs.tag }} + image_tag: ${{ needs.fastfeedback.outputs.image_tag }} semver: ${{ needs.fastfeedback.outputs.semver }} # prod: # uses: ./.github/workflows/external-workflow-prod.yaml \ No newline at end of file diff --git a/.github/workflows/external-workflow-exttests.yaml b/.github/workflows/external-workflow-exttests.yaml index 1518d30..f69a718 100644 --- a/.github/workflows/external-workflow-exttests.yaml +++ b/.github/workflows/external-workflow-exttests.yaml @@ -10,7 +10,7 @@ on: required: false type: boolean default: false - tag: + image_tag: required: false type: string default: '' @@ -43,7 +43,7 @@ jobs: source_github_env: ${{ vars.PRIMARY_DEV }} dest_github_env: ${{ vars.PRIMARY_PROD }} promotion-stage: extended-tests - tag: ${{ inputs.tag }} + tag: ${{ inputs.image_tag }} semver: ${{ inputs.semver }} @@ -53,7 +53,7 @@ jobs: with: command: p2p-extended-tests envmatrix: ${{ vars.STAGE_DEV }} - tag: ${{ inputs.tag }} + tag: ${{ inputs.image_tag }} semver: ${{ inputs.semver }} dev-deploy: @@ -64,7 +64,7 @@ jobs: with: command: p2p-dev envmatrix: ${{ inputs.stage-dev }} - tag: ${{ needs.version.outputs.image_tag }} + tag: ${{ inputs.image_tag }} semver: ${{ needs.version.outputs.semver }} promote-post-extended-tests: @@ -74,5 +74,5 @@ jobs: source_github_env: ${{ vars.PRIMARY_DEV }} dest_github_env: ${{ vars.PRIMARY_PROD }} promotion-stage: prod - tag: ${{ inputs.tag }} + tag: ${{ inputs.image_tag }} semver: ${{ inputs.semver }} diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index dbf1d03..8942f9a 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -68,24 +68,18 @@ jobs: build: needs: [version] uses: ./.github/workflows/envmatrix-execute-command.yaml - strategy: - matrix: ${{ fromJSON(inputs.stage-dev) }} - fail-fast: false with: command: p2p-build - github_env: ${{ matrix.deploy_env }} + envmatrix: ${{ inputs.stage-dev }} tag: ${{ needs.version.outputs.image_tag }} semver: ${{ needs.version.outputs.semver }} functional-test: needs: [version, build] uses: ./.github/workflows/envmatrix-execute-command.yaml - strategy: - matrix: ${{ fromJSON(inputs.stage-dev) }} - fail-fast: false with: command: p2p-functional - github_env: ${{ matrix.deploy_env }} + envmatrix: ${{ inputs.stage-dev }} tag: ${{ needs.version.outputs.image_tag }} semver: ${{ needs.version.outputs.semver }} @@ -93,12 +87,9 @@ jobs: nft-test: needs: [version, functional-test] uses: ./.github/workflows/envmatrix-execute-command.yaml - strategy: - matrix: ${{ fromJSON(inputs.stage-dev) }} - fail-fast: false with: command: p2p-nft - github_env: ${{ matrix.deploy_env }} + envmatrix: ${{ inputs.stage-dev }} tag: ${{ needs.version.outputs.image_tag }} semver: ${{ needs.version.outputs.semver }} From 6fdb89b9458099fbfc453a43585e91eb37df7135 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 16:52:57 +0000 Subject: [PATCH 08/50] quick-commit - Wed 11/29/2023 16:52:57 --- .../workflows/external-workflow-fastfeedback.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index 8942f9a..dbf1d03 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -68,18 +68,24 @@ jobs: build: needs: [version] uses: ./.github/workflows/envmatrix-execute-command.yaml + strategy: + matrix: ${{ fromJSON(inputs.stage-dev) }} + fail-fast: false with: command: p2p-build - envmatrix: ${{ inputs.stage-dev }} + github_env: ${{ matrix.deploy_env }} tag: ${{ needs.version.outputs.image_tag }} semver: ${{ needs.version.outputs.semver }} functional-test: needs: [version, build] uses: ./.github/workflows/envmatrix-execute-command.yaml + strategy: + matrix: ${{ fromJSON(inputs.stage-dev) }} + fail-fast: false with: command: p2p-functional - envmatrix: ${{ inputs.stage-dev }} + github_env: ${{ matrix.deploy_env }} tag: ${{ needs.version.outputs.image_tag }} semver: ${{ needs.version.outputs.semver }} @@ -87,9 +93,12 @@ jobs: nft-test: needs: [version, functional-test] uses: ./.github/workflows/envmatrix-execute-command.yaml + strategy: + matrix: ${{ fromJSON(inputs.stage-dev) }} + fail-fast: false with: command: p2p-nft - envmatrix: ${{ inputs.stage-dev }} + github_env: ${{ matrix.deploy_env }} tag: ${{ needs.version.outputs.image_tag }} semver: ${{ needs.version.outputs.semver }} From 905e89788f65b13e76b1c37661aa369ba22ae694 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 17:02:13 +0000 Subject: [PATCH 09/50] quick-commit - Wed 11/29/2023 17:02:13 --- .github/workflows/action-execute-command.yaml | 79 +++++++++++++++++++ .../external-workflow-fastfeedback.yaml | 6 +- 2 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/action-execute-command.yaml diff --git a/.github/workflows/action-execute-command.yaml b/.github/workflows/action-execute-command.yaml new file mode 100644 index 0000000..dffa6c0 --- /dev/null +++ b/.github/workflows/action-execute-command.yaml @@ -0,0 +1,79 @@ +name: '${{ inputs.command }} (${{ inputs.github_env }})' +inputs: + command: + required: true + type: string + github_env: + required: false + type: string + default: '' + dry-run: + required: false + type: boolean + default: false + region: + required: false + type: string + default: europe-west2 + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + zone: + required: false + type: string + default: europe-west2-a + pre-targets: + description: | + Make targets to run before the command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after the command + required: false + type: string + default: '' + + +environment: ${{ inputs.github_env }} +env: + TAG_VERSION: ${{ inputs.tag }} + SEMVER: ${{ inputs.semver }} + REGION: ${{ inputs.region }} + REGISTRY: ${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant + SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com + WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} + BASE_URL: ${{ vars.BASE_URL }} + ENVIRONMENT: ${{ vars.ENV }} + ENV: ${{ vars.ENV }} + PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} + PROJECT_ID: ${{ vars.PROJECT_ID }} + TENANT_NAME: ${{ vars.TENANT_NAME }} + ADDITIONAL_ENV_VARS: "FOO,BAR" +runs: + using: 'composite' + steps: + - name: add_additional_env_vars + env: + ALL_VARS: ${{ toJSON(vars) }}" + run: | + echo "ALL_VARS=$ALL_VARS" + - name: print + run: | + echo "TAG_VERSION=$TAG_VERSION" + echo "SEMVER=$SEMVER" + echo "BASE_URL=$BASE_URL" + echo "PROJECT_ID=$PROJECT_ID" + echo "REGION=$REGION" + echo "SERVICE_ACCOUNT=$SERVICE_ACCOUNT" + echo "WORKLOAD_IDENTITY_PROVIDER=$WORKLOAD_IDENTITY_PROVIDER" + echo "REGISTRY=$REGISTRY" + echo "PROJECT_NUMBER=$PROJECT_NUMBER" + echo "TENANT_NAME=$TENANT_NAME" + echo "ENV=$ENVIRONMENT" diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index dbf1d03..b4c3dbb 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -67,7 +67,7 @@ jobs: build: needs: [version] - uses: ./.github/workflows/envmatrix-execute-command.yaml + uses: ./.github/workflows/execute-command.yaml strategy: matrix: ${{ fromJSON(inputs.stage-dev) }} fail-fast: false @@ -79,7 +79,7 @@ jobs: functional-test: needs: [version, build] - uses: ./.github/workflows/envmatrix-execute-command.yaml + uses: ./.github/workflows/execute-command.yaml strategy: matrix: ${{ fromJSON(inputs.stage-dev) }} fail-fast: false @@ -92,7 +92,7 @@ jobs: nft-test: needs: [version, functional-test] - uses: ./.github/workflows/envmatrix-execute-command.yaml + uses: ./.github/workflows/execute-command.yaml strategy: matrix: ${{ fromJSON(inputs.stage-dev) }} fail-fast: false From 9daa49257f2757825644ba7c707a8b7bf199e522 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 17:15:26 +0000 Subject: [PATCH 10/50] quick-commit - Wed 11/29/2023 17:15:26 --- .../execute-command/action.yaml} | 0 .../workflows/external-workflow-fastfeedback.yaml | 14 +++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) rename .github/{workflows/action-execute-command.yaml => actions/execute-command/action.yaml} (100%) diff --git a/.github/workflows/action-execute-command.yaml b/.github/actions/execute-command/action.yaml similarity index 100% rename from .github/workflows/action-execute-command.yaml rename to .github/actions/execute-command/action.yaml diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index b4c3dbb..b01130d 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -71,11 +71,15 @@ jobs: strategy: matrix: ${{ fromJSON(inputs.stage-dev) }} fail-fast: false - with: - command: p2p-build - github_env: ${{ matrix.deploy_env }} - tag: ${{ needs.version.outputs.image_tag }} - semver: ${{ needs.version.outputs.semver }} + steps: + - uses: actions/checkout@v4 + - name: execute-command + uses: ./.github/workflows/execute-command.yaml + with: + command: p2p-build + github_env: ${{ matrix.deploy_env }} + tag: ${{ needs.version.outputs.image_tag }} + semver: ${{ needs.version.outputs.semver }} functional-test: needs: [version, build] From 5fa6f62445e7c35a7baff7159a91270dacdfaa0c Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 17:16:40 +0000 Subject: [PATCH 11/50] quick-commit - Wed 11/29/2023 17:16:40 --- .github/workflows/external-workflow-fastfeedback.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index b01130d..4f80ea1 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -67,7 +67,6 @@ jobs: build: needs: [version] - uses: ./.github/workflows/execute-command.yaml strategy: matrix: ${{ fromJSON(inputs.stage-dev) }} fail-fast: false From 06b3a421f027c28daa6a53ea06fa7e9ceb66c044 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 17:17:34 +0000 Subject: [PATCH 12/50] quick-commit - Wed 11/29/2023 17:17:34 --- .github/workflows/external-workflow-fastfeedback.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index 4f80ea1..723677c 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -67,6 +67,7 @@ jobs: build: needs: [version] + runs-on: ubuntu-latest strategy: matrix: ${{ fromJSON(inputs.stage-dev) }} fail-fast: false From 1fa479af62fc58a71785eb4b37a48064548c9638 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 17:19:14 +0000 Subject: [PATCH 13/50] quick-commit - Wed 11/29/2023 17:19:14 --- .github/workflows/external-workflow-fastfeedback.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index 723677c..acaf256 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -74,7 +74,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: execute-command - uses: ./.github/workflows/execute-command.yaml + uses: actions/execute-command with: command: p2p-build github_env: ${{ matrix.deploy_env }} From 685d356e021aee11f0393727db530eb8eafc7d8f Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 17:20:18 +0000 Subject: [PATCH 14/50] quick-commit - Wed 11/29/2023 17:20:18 --- .github/workflows/external-workflow-fastfeedback.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index acaf256..fa85b08 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -74,7 +74,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: execute-command - uses: actions/execute-command + uses: actions/execute-command@v1 with: command: p2p-build github_env: ${{ matrix.deploy_env }} From 1ccde2264c1f282e96a4fac5ca39d53041a97240 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 17:21:42 +0000 Subject: [PATCH 15/50] quick-commit - Wed 11/29/2023 17:21:42 --- .github/workflows/external-workflow-fastfeedback.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index fa85b08..f5f8f78 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -74,7 +74,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: execute-command - uses: actions/execute-command@v1 + uses: ./.github/actions/execute-command with: command: p2p-build github_env: ${{ matrix.deploy_env }} From 18df1632227a832e23009852bfa68278ab5ebbd5 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 18:14:51 +0000 Subject: [PATCH 16/50] quick-commit - Wed 11/29/2023 18:14:50 --- .github/actions/execute-command/action.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/actions/execute-command/action.yaml b/.github/actions/execute-command/action.yaml index dffa6c0..6af7599 100644 --- a/.github/actions/execute-command/action.yaml +++ b/.github/actions/execute-command/action.yaml @@ -1,4 +1,3 @@ -name: '${{ inputs.command }} (${{ inputs.github_env }})' inputs: command: required: true @@ -59,6 +58,21 @@ env: runs: using: 'composite' steps: + - run | + echo "TAG_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV + echo "SEMVER=${{ inputs.semver }}" >> $GITHUB_ENV + echo "REGION=${{ inputs.region }}" >> $GITHUB_ENV + echo "REGISTRY=${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant" >> $GITHUB_ENV + echo "SERVICE_ACCOUNT=p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com" >> $GITHUB_ENV + echo "WORKLOAD_IDENTITY_PROVIDER=projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }}" >> $GITHUB_ENV + echo "BASE_URL=${{ vars.BASE_URL }}" >> $GITHUB_ENV + echo "ENVIRONMENT=${{ vars.ENV }}" >> $GITHUB_ENV + echo "ENV=${{ vars.ENV }}" >> $GITHUB_ENV + echo "PROJECT_NUMBER=${{ vars.PROJECT_NUMBER }}" >> $GITHUB_ENV + echo "PROJECT_ID=${{ vars.PROJECT_ID }}" >> $GITHUB_ENV + echo "TENANT_NAME=${{ vars.TENANT_NAME }}" >> $GITHUB_ENV + echo "ADDITIONAL_ENV_VARS=FOO,BAR" >> $GITHUB_ENV + - name: add_additional_env_vars env: ALL_VARS: ${{ toJSON(vars) }}" From 9330adad7713c087f383b46440d81dc0490f9033 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 18:34:13 +0000 Subject: [PATCH 17/50] quick-commit - Wed 11/29/2023 18:34:13 --- .github/actions/execute-command/action.yaml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/actions/execute-command/action.yaml b/.github/actions/execute-command/action.yaml index 6af7599..de97a91 100644 --- a/.github/actions/execute-command/action.yaml +++ b/.github/actions/execute-command/action.yaml @@ -41,20 +41,6 @@ inputs: environment: ${{ inputs.github_env }} -env: - TAG_VERSION: ${{ inputs.tag }} - SEMVER: ${{ inputs.semver }} - REGION: ${{ inputs.region }} - REGISTRY: ${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant - SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com - WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} - BASE_URL: ${{ vars.BASE_URL }} - ENVIRONMENT: ${{ vars.ENV }} - ENV: ${{ vars.ENV }} - PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} - PROJECT_ID: ${{ vars.PROJECT_ID }} - TENANT_NAME: ${{ vars.TENANT_NAME }} - ADDITIONAL_ENV_VARS: "FOO,BAR" runs: using: 'composite' steps: From fc5d34162967cf8ce94a2013d13b6c9090dd6c96 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 18:36:45 +0000 Subject: [PATCH 18/50] quick-commit - Wed 11/29/2023 18:36:45 --- .github/actions/execute-command/action.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/actions/execute-command/action.yaml b/.github/actions/execute-command/action.yaml index de97a91..4ad9234 100644 --- a/.github/actions/execute-command/action.yaml +++ b/.github/actions/execute-command/action.yaml @@ -44,7 +44,7 @@ environment: ${{ inputs.github_env }} runs: using: 'composite' steps: - - run | + - run: | echo "TAG_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV echo "SEMVER=${{ inputs.semver }}" >> $GITHUB_ENV echo "REGION=${{ inputs.region }}" >> $GITHUB_ENV @@ -59,11 +59,6 @@ runs: echo "TENANT_NAME=${{ vars.TENANT_NAME }}" >> $GITHUB_ENV echo "ADDITIONAL_ENV_VARS=FOO,BAR" >> $GITHUB_ENV - - name: add_additional_env_vars - env: - ALL_VARS: ${{ toJSON(vars) }}" - run: | - echo "ALL_VARS=$ALL_VARS" - name: print run: | echo "TAG_VERSION=$TAG_VERSION" From 5180b0707e4b3ca2976d58c24512e89a8cc71b43 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 18:53:11 +0000 Subject: [PATCH 19/50] quick-commit - Wed 11/29/2023 18:53:11 --- .github/actions/execute-command/action.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/execute-command/action.yaml b/.github/actions/execute-command/action.yaml index 4ad9234..eeea89c 100644 --- a/.github/actions/execute-command/action.yaml +++ b/.github/actions/execute-command/action.yaml @@ -1,3 +1,5 @@ +name: foo + inputs: command: required: true @@ -40,7 +42,11 @@ inputs: default: '' -environment: ${{ inputs.github_env }} + + + + +#environment: ${{ inputs.github_env }} runs: using: 'composite' steps: From 6d4f1288769ec192a1cba4cfba3b01381d049506 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 22:23:39 +0000 Subject: [PATCH 20/50] quick-commit - Wed 11/29/2023 22:23:39 --- .github/actions/execute-command/action.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/execute-command/action.yaml b/.github/actions/execute-command/action.yaml index eeea89c..f2ae781 100644 --- a/.github/actions/execute-command/action.yaml +++ b/.github/actions/execute-command/action.yaml @@ -50,7 +50,8 @@ inputs: runs: using: 'composite' steps: - - run: | + - shell: bash + run: | echo "TAG_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV echo "SEMVER=${{ inputs.semver }}" >> $GITHUB_ENV echo "REGION=${{ inputs.region }}" >> $GITHUB_ENV @@ -65,7 +66,7 @@ runs: echo "TENANT_NAME=${{ vars.TENANT_NAME }}" >> $GITHUB_ENV echo "ADDITIONAL_ENV_VARS=FOO,BAR" >> $GITHUB_ENV - - name: print + - shell: bash run: | echo "TAG_VERSION=$TAG_VERSION" echo "SEMVER=$SEMVER" From 2f244660863e898c837910168517bc5f5f4d2ef2 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 22:25:18 +0000 Subject: [PATCH 21/50] quick-commit - Wed 11/29/2023 22:25:18 --- .github/actions/execute-command/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/execute-command/action.yaml b/.github/actions/execute-command/action.yaml index f2ae781..97423ee 100644 --- a/.github/actions/execute-command/action.yaml +++ b/.github/actions/execute-command/action.yaml @@ -46,7 +46,7 @@ inputs: -#environment: ${{ inputs.github_env }} +environment: ${{ inputs.github_env }} runs: using: 'composite' steps: From 067f15e776bb73bb30794db546d8cecc9b3baacd Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 22:26:35 +0000 Subject: [PATCH 22/50] quick-commit - Wed 11/29/2023 22:26:35 --- .github/actions/execute-command/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/execute-command/action.yaml b/.github/actions/execute-command/action.yaml index 97423ee..89d869b 100644 --- a/.github/actions/execute-command/action.yaml +++ b/.github/actions/execute-command/action.yaml @@ -46,7 +46,7 @@ inputs: -environment: ${{ inputs.github_env }} +environment: cecg-sandbox runs: using: 'composite' steps: From 03cf86254117468dce4cab32c4592650be2245d4 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 22:27:47 +0000 Subject: [PATCH 23/50] quick-commit - Wed 11/29/2023 22:27:47 --- .github/actions/execute-command/action.yaml | 1 - .github/workflows/external-workflow-fastfeedback.yaml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/execute-command/action.yaml b/.github/actions/execute-command/action.yaml index 89d869b..f00ab18 100644 --- a/.github/actions/execute-command/action.yaml +++ b/.github/actions/execute-command/action.yaml @@ -46,7 +46,6 @@ inputs: -environment: cecg-sandbox runs: using: 'composite' steps: diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index f5f8f78..02f5c29 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -71,6 +71,7 @@ jobs: strategy: matrix: ${{ fromJSON(inputs.stage-dev) }} fail-fast: false + environment: ${{ matrix.deploy_env }} steps: - uses: actions/checkout@v4 - name: execute-command From a570ac2125569a5fa6aecdf2b4fa3113c009eca4 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 23:00:04 +0000 Subject: [PATCH 24/50] quick-commit - Wed 11/29/2023 23:00:04 --- .../external-workflow-fastfeedback.yaml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index 02f5c29..cc0b107 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -35,6 +35,7 @@ jobs: version: runs-on: ubuntu-latest env: + GETME: ${{ vars.GETME || 'default' }} USE_SEMVER_AS_IMAGE_TAG: true outputs: image_tag: ${{ steps.version.outputs.image_tag }} @@ -51,6 +52,7 @@ jobs: id: version shell: bash run: | + echo "GETME=$GETME" git fetch --prune --unshallow --tags DESCRIBE="$(git describe --match 'prefix_*' --abbrev=7)" CLEANED_DESCRIBE="$(echo $DESCRIBE | tr '-' '.')" @@ -67,20 +69,15 @@ jobs: build: needs: [version] - runs-on: ubuntu-latest + uses: ./.github/workflows/execute-command.yaml strategy: matrix: ${{ fromJSON(inputs.stage-dev) }} fail-fast: false - environment: ${{ matrix.deploy_env }} - steps: - - uses: actions/checkout@v4 - - name: execute-command - uses: ./.github/actions/execute-command - with: - command: p2p-build - github_env: ${{ matrix.deploy_env }} - tag: ${{ needs.version.outputs.image_tag }} - semver: ${{ needs.version.outputs.semver }} + with: + command: p2p-build + github_env: ${{ matrix.deploy_env }} + tag: ${{ needs.version.outputs.image_tag }} + semver: ${{ }} functional-test: needs: [version, build] From bc8ebc662621ff0f19c18e342f8fa415236aee34 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 23:01:29 +0000 Subject: [PATCH 25/50] quick-commit - Wed 11/29/2023 23:01:29 --- .github/workflows/external-workflow-fastfeedback.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index cc0b107..5a3cfd5 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -77,7 +77,7 @@ jobs: command: p2p-build github_env: ${{ matrix.deploy_env }} tag: ${{ needs.version.outputs.image_tag }} - semver: ${{ }} + semver: ${{ needs.version.outputs.semver }} functional-test: needs: [version, build] From 260b70a5ac8d5dfe687db2f21710afdd310db7f0 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 23:30:26 +0000 Subject: [PATCH 26/50] quick-commit - Wed 11/29/2023 23:30:26 --- .github/workflows/external-workflow-fastfeedback.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index 5a3cfd5..5866f92 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -68,6 +68,7 @@ jobs: fi build: + name: build needs: [version] uses: ./.github/workflows/execute-command.yaml strategy: @@ -80,6 +81,7 @@ jobs: semver: ${{ needs.version.outputs.semver }} functional-test: + name: functional-test needs: [version, build] uses: ./.github/workflows/execute-command.yaml strategy: From 0b8706a7f4a771b742bf1cdaddf20b1914abc15a Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 23:31:55 +0000 Subject: [PATCH 27/50] quick-commit - Wed 11/29/2023 23:31:55 --- .github/workflows/external-workflow-fastfeedback.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml index 5866f92..800bf04 100644 --- a/.github/workflows/external-workflow-fastfeedback.yaml +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -1,3 +1,4 @@ +run-name: boom on: workflow_call: From faf750aa79454578a81bdbe5d55d823bdb1bf67d Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 23:33:34 +0000 Subject: [PATCH 28/50] quick-commit - Wed 11/29/2023 23:33:34 --- .github/workflows/cd.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index c5aae59..8da6ff6 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -10,10 +10,11 @@ permissions: jobs: fastfeedback: uses: ./.github/workflows/external-workflow-fastfeedback.yaml + concurrency: ${{ github.run_id }} extendedtests: uses: ./.github/workflows/external-workflow-exttests.yaml - needs: [fastfeedback] + concurrency: ${{ github.run_id }} with: image_tag: ${{ needs.fastfeedback.outputs.image_tag }} semver: ${{ needs.fastfeedback.outputs.semver }} From 619bacb1e67fd3066ce5c63227cda265e6f53bf3 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 23:43:57 +0000 Subject: [PATCH 29/50] quick-commit - Wed 11/29/2023 23:43:57 --- .github/workflows/external-promote-image.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/external-promote-image.yaml b/.github/workflows/external-promote-image.yaml index 47e09c0..949829c 100644 --- a/.github/workflows/external-promote-image.yaml +++ b/.github/workflows/external-promote-image.yaml @@ -90,8 +90,10 @@ jobs: steps: - name: print run: | + echo "SOURCE_GITHUB_ENV=${{ inputs.source_github_env }}" echo "SOURCE_GITHUB_ENV=${{ inputs.source_github_env }}" echo "DEST_GITHUB_ENV=${{ inputs.dest_github_env }}" + echo "${{ toJSON(env) }}" echo "SOURCE_REGISTRY=$SOURCE_REGISTRY" echo "SOURCE_SERVICE_ACCOUNT=$SOURCE_SERVICE_ACCOUNT" echo "SOURCE_WORKLOAD_IDENTITY_PROVIDER=$SOURCE_WORKLOAD_IDENTITY_PROVIDER" From ad3c7084db49ae8e049e690ab107bd5ca5e8fd0d Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 23:46:07 +0000 Subject: [PATCH 30/50] quick-commit - Wed 11/29/2023 23:46:07 --- .github/workflows/external-promote-image.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/external-promote-image.yaml b/.github/workflows/external-promote-image.yaml index 949829c..c838d4b 100644 --- a/.github/workflows/external-promote-image.yaml +++ b/.github/workflows/external-promote-image.yaml @@ -90,10 +90,9 @@ jobs: steps: - name: print run: | - echo "SOURCE_GITHUB_ENV=${{ inputs.source_github_env }}" echo "SOURCE_GITHUB_ENV=${{ inputs.source_github_env }}" echo "DEST_GITHUB_ENV=${{ inputs.dest_github_env }}" - echo "${{ toJSON(env) }}" + echo "${{ toJSON(env) }}" | jq . echo "SOURCE_REGISTRY=$SOURCE_REGISTRY" echo "SOURCE_SERVICE_ACCOUNT=$SOURCE_SERVICE_ACCOUNT" echo "SOURCE_WORKLOAD_IDENTITY_PROVIDER=$SOURCE_WORKLOAD_IDENTITY_PROVIDER" From 8e7223b305af1b421c04545fe2efbe29f1f75338 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Wed, 29 Nov 2023 23:48:15 +0000 Subject: [PATCH 31/50] quick-commit - Wed 11/29/2023 23:48:15 --- .github/workflows/external-promote-image.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/external-promote-image.yaml b/.github/workflows/external-promote-image.yaml index c838d4b..dd02fb4 100644 --- a/.github/workflows/external-promote-image.yaml +++ b/.github/workflows/external-promote-image.yaml @@ -92,7 +92,9 @@ jobs: run: | echo "SOURCE_GITHUB_ENV=${{ inputs.source_github_env }}" echo "DEST_GITHUB_ENV=${{ inputs.dest_github_env }}" - echo "${{ toJSON(env) }}" | jq . + cat < Date: Wed, 29 Nov 2023 23:52:06 +0000 Subject: [PATCH 32/50] quick-commit - Wed 11/29/2023 23:52:06 --- .github/workflows/external-promote-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/external-promote-image.yaml b/.github/workflows/external-promote-image.yaml index dd02fb4..6cb5e5f 100644 --- a/.github/workflows/external-promote-image.yaml +++ b/.github/workflows/external-promote-image.yaml @@ -92,7 +92,7 @@ jobs: run: | echo "SOURCE_GITHUB_ENV=${{ inputs.source_github_env }}" echo "DEST_GITHUB_ENV=${{ inputs.dest_github_env }}" - cat < Date: Wed, 29 Nov 2023 23:53:12 +0000 Subject: [PATCH 33/50] quick-commit - Wed 11/29/2023 23:53:12 --- .github/workflows/cd.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 8da6ff6..c5aae59 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -10,11 +10,10 @@ permissions: jobs: fastfeedback: uses: ./.github/workflows/external-workflow-fastfeedback.yaml - concurrency: ${{ github.run_id }} extendedtests: uses: ./.github/workflows/external-workflow-exttests.yaml - concurrency: ${{ github.run_id }} + needs: [fastfeedback] with: image_tag: ${{ needs.fastfeedback.outputs.image_tag }} semver: ${{ needs.fastfeedback.outputs.semver }} From c11d05c7c05be0dd94571b66f87553f018720e1d Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 08:57:25 +0000 Subject: [PATCH 34/50] quick-commit - Fri 12/01/2023 08:57:25 --- scratch/dev.yaml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/scratch/dev.yaml b/scratch/dev.yaml index 880c373..8d43daf 100644 --- a/scratch/dev.yaml +++ b/scratch/dev.yaml @@ -5,9 +5,23 @@ on: types: [opened, synchronize, labeled, unlabeled] jobs: - fastfeedback: - uses: ./.github/workflows/p2p-workflow-definition.yaml - extendedtests: - uses: ./.github/workflows/p2p-workflow-definition.yaml - prod: - uses: ./.github/workflows/p2p-workflow-definition.yaml \ No newline at end of file + + version: + runs-on: ubuntu-latest + env: + USE_SEMVER_AS_IMAGE_TAG: true + FOO: ${{ var.STAGE_DEV }} + steps: + - name: Get version + id: version + shell: bash + run: | + echo "STAGE_DEV=$STAGE_DEV" + + +# fastfeedback: +# uses: ./.github/workflows/p2p-workflow-definition.yaml +# extendedtests: +# uses: ./.github/workflows/p2p-workflow-definition.yaml +# prod: +# uses: ./.github/workflows/p2p-workflow-definition.yaml \ No newline at end of file From aec1e5116347293e73a0674a46bf54329d5ca32e Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 09:01:56 +0000 Subject: [PATCH 35/50] quick-commit - Fri 12/01/2023 09:01:56 --- .github/workflows/cd.yaml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index c5aae59..196ceeb 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -8,14 +8,25 @@ permissions: id-token: write jobs: - fastfeedback: - uses: ./.github/workflows/external-workflow-fastfeedback.yaml - - extendedtests: - uses: ./.github/workflows/external-workflow-exttests.yaml - needs: [fastfeedback] - with: - image_tag: ${{ needs.fastfeedback.outputs.image_tag }} - semver: ${{ needs.fastfeedback.outputs.semver }} -# prod: -# uses: ./.github/workflows/external-workflow-prod.yaml \ No newline at end of file + version: + runs-on: ubuntu-latest + env: + USE_SEMVER_AS_IMAGE_TAG: true + FOO: ${{ var.STAGE_DEV }} + steps: + - name: Get version + id: version + shell: bash + run: | + echo "STAGE_DEV=$STAGE_DEV" +# fastfeedback: +# uses: ./.github/workflows/external-workflow-fastfeedback.yaml +# +# extendedtests: +# uses: ./.github/workflows/external-workflow-exttests.yaml +# needs: [fastfeedback] +# with: +# image_tag: ${{ needs.fastfeedback.outputs.image_tag }} +# semver: ${{ needs.fastfeedback.outputs.semver }} +## prod: +## uses: ./.github/workflows/external-workflow-prod.yaml \ No newline at end of file From b99e6168343d85bcb46ae33902a2bf9256cdb4c5 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 09:03:58 +0000 Subject: [PATCH 36/50] quick-commit - Fri 12/01/2023 09:03:58 --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 196ceeb..0795720 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest env: USE_SEMVER_AS_IMAGE_TAG: true - FOO: ${{ var.STAGE_DEV }} + FOO: ${{ vars.STAGE_DEV }} steps: - name: Get version id: version From 7adf9d5458398e6a835a5d71fd86e4d458e50d4e Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 09:05:11 +0000 Subject: [PATCH 37/50] quick-commit - Fri 12/01/2023 09:05:11 --- .github/workflows/cd.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 0795720..0cb1137 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -11,11 +11,9 @@ jobs: version: runs-on: ubuntu-latest env: - USE_SEMVER_AS_IMAGE_TAG: true - FOO: ${{ vars.STAGE_DEV }} + STAGE_DEV: ${{ vars.STAGE_DEV }} steps: - name: Get version - id: version shell: bash run: | echo "STAGE_DEV=$STAGE_DEV" From 2d4bb9f7ba3af1b0a0660d62818386da5698e127 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 09:13:48 +0000 Subject: [PATCH 38/50] quick-commit - Fri 12/01/2023 09:13:48 --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 0cb1137..a07ce50 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -11,7 +11,7 @@ jobs: version: runs-on: ubuntu-latest env: - STAGE_DEV: ${{ vars.STAGE_DEV }} + STAGE_DEV: ${{ fromJson(vars.STAGE_DEV)[0] }} steps: - name: Get version shell: bash From 72a6a449e8a939837a869379b09f572a97b1badc Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 09:18:28 +0000 Subject: [PATCH 39/50] quick-commit - Fri 12/01/2023 09:18:28 --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index a07ce50..81d62d1 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -11,7 +11,7 @@ jobs: version: runs-on: ubuntu-latest env: - STAGE_DEV: ${{ fromJson(vars.STAGE_DEV)[0] }} + STAGE_DEV: ${{ fromJson(vars.STAGE_DEV)['include'] }} steps: - name: Get version shell: bash From 1330a50694b7fda818154dcfbe9ae3dae89cfa8d Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 09:58:41 +0000 Subject: [PATCH 40/50] quick-commit - Fri 12/01/2023 09:58:41 --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 81d62d1..680ea35 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -11,7 +11,7 @@ jobs: version: runs-on: ubuntu-latest env: - STAGE_DEV: ${{ fromJson(vars.STAGE_DEV)['include'] }} + STAGE_DEV: ${{ (fromJson(vars.STAGE_DEV)).include }} steps: - name: Get version shell: bash From a8991036616e87fed3003528e18592213ebe4f27 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 10:00:31 +0000 Subject: [PATCH 41/50] quick-commit - Fri 12/01/2023 10:00:31 --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 680ea35..1263b7d 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -11,7 +11,7 @@ jobs: version: runs-on: ubuntu-latest env: - STAGE_DEV: ${{ (fromJson(vars.STAGE_DEV)).include }} + STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include }} steps: - name: Get version shell: bash From bb7e88a472669c4843291d78c23e80805f730cd8 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 10:04:45 +0000 Subject: [PATCH 42/50] quick-commit - Fri 12/01/2023 10:04:45 --- .github/workflows/cd.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 1263b7d..daf0d04 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -8,6 +8,24 @@ permissions: id-token: write jobs: + + testJob: + name: Test + runs-on: ubuntu-latest + steps: + - id: set_var + run: | + content=`cat ./path/to/package.json` + # the following lines are only required for multi line json + content="${content//'%'/'%25'}" + content="${content//$'\n'/'%0A'}" + content="${content//$'\r'/'%0D'}" + # end of optional handling for multi line json + echo "::set-output name=packageJson::$content" + - run: | + echo "${{fromJson(steps.set_var.outputs.packageJson).version}}" + + version: runs-on: ubuntu-latest env: From 2a322b41026238fc3ba54636839a8e8171a3d5aa Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 10:05:14 +0000 Subject: [PATCH 43/50] quick-commit - Fri 12/01/2023 10:05:14 --- .github/workflows/cd.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index daf0d04..b54fbca 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -10,8 +10,8 @@ permissions: jobs: testJob: - name: Test runs-on: ubuntu-latest + continue-on-error: true steps: - id: set_var run: | @@ -28,6 +28,7 @@ jobs: version: runs-on: ubuntu-latest + continue-on-error: true env: STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include }} steps: From 7d78447ad3aeede9718738896e6a4715fdba158e Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 10:14:01 +0000 Subject: [PATCH 44/50] quick-commit - Fri 12/01/2023 10:14:01 --- .github/workflows/cd.yaml | 2 +- package.json | 241 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 package.json diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index b54fbca..d6e3804 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -15,7 +15,7 @@ jobs: steps: - id: set_var run: | - content=`cat ./path/to/package.json` + content=`cat ./package.json` # the following lines are only required for multi line json content="${content//'%'/'%25'}" content="${content//$'\n'/'%0A'}" diff --git a/package.json b/package.json new file mode 100644 index 0000000..7b27122 --- /dev/null +++ b/package.json @@ -0,0 +1,241 @@ +{ + "name": "ecosystem-ui", + "version": "1.3.24", + "private": true, + "scripts": { + "build": "webpack", + "build:production": "webpack --mode=production", + "ci:prod": "yarn test && yarn build:production", + "clean": "rm -rf dist-* dist", + "clean:all": "rm -rf dist-* dist node_modules reports .cache", + "start": "webpack serve", + "start:test": "webpack-dev-server --env=integration", + "lint": "yarn lint:scss && yarn lint:ts", + "lint:fix": "yarn lint:scss:fix && yarn lint:ts:fix", + "lint:ts": "yarn lint:ts:cmd --ext ts,tsx,js,jsx .", + "lint:ts:cmd": "eslint --cache --cache-location .cache/.eslintcache", + "lint:ts:fix": "yarn lint:ts --fix", + "lint:scss": "yarn lint:scss:cmd src", + "lint:scss:cmd": "stylelint --cache --cache-location .cache/.stylelintcache", + "lint:scss:fix": "yarn lint:scss:cmd --fix src", + "test": "NODE_OPTIONS=\"--unhandled-rejections=strict\" && jest --coverage --maxWorkers=25%", + "test:flaky": "NODE_OPTIONS=\"--unhandled-rejections=strict\" && jest --config ./jest.flaky.config.js --maxWorkers=75% --passWithNoTests", + "test:ui-compliance": "NODE_OPTIONS=\"--unhandled-rejections=strict\" && jest --group=ui-compliance --maxWorkers=25%", + "test:no-cache": "yarn test --clearCache && yarn test", + "test:integration": "cypress run -c integrationFolder=cypress/integration/$TEST_DIR --browser chrome --headless", + "test:integration:ci": "./scripts/runCypressInCi.sh test:integration .", + "test:integration:open": "cypress open -c integrationFolder=cypress/integration/$TEST_DIR", + "test:integration:local:ci": "CYPRESS_OVERRIDE_IMPORTMAP='true' cypress run -c integrationFolder=cypress/integration/$TEST_DIR --browser chrome --headless", + "test:integration:local:open": "CYPRESS_OVERRIDE_IMPORTMAP='true' cypress open -c integrationFolder=cypress/integration/$TEST_DIR", + "cypress": "cypress open", + "test:system": "cypress run -c integrationFolder=cypress/system", + "test:system:ci": "./scripts/waitForServicesUp.sh && cypress run -c integrationFolder=cypress/system/$TEST_DIR --browser chrome --headless", + "test:system:open": "cypress open -c integrationFolder=cypress/system/$TEST_DIR", + "test:unit:duration:sorted:csv": "junit2json ./reports/coverage/junit.xml > ./reports/coverage/uiUnitTestsResults.json && ts-node ./scripts/createLiteSortedUiUnitTestsDurationJson.ts && json2csv -i ./reports/coverage/liteSortedUiUnitTestsDuration.json -o ./reports/coverage/liteSortedUiUnitTestsDuration.csv -p --unwind", + "cy:reports:aggregate": "mochawesome-merge ./reports/cypress/results/* > ./reports/cypress/results/cypress-report.json", + "cy:reports:html": "marge --reportDir reports/cypress/results/ --cdn true --charts true reports/cypress/results/cypress-report.json", + "cy:reports:generate": "yarn cy:reports:aggregate && yarn cy:reports:html", + "report": "open ./reports/coverage/lcov-report/index.html", + "test:integration:ci:docker": "./scripts/runCypressInDocker.sh test:integration .", + "typecheck": "bash -c 'tsc --noEmit'", + "typecheck:cmd": "yarn typecheck && yarn typecheck:cypress", + "typecheck:cypress": "tsc --noEmit --project ./cypress/tsconfig.json", + "sonar": "sonar-scanner" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all", + "not ie > 1", + "not ie_mob > 1" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "dependencies": { + "@apollo/client": "^3.1.4", + "@babel/helper-call-delegate": "^7.12.13", + "@ecosystem/brand-manager-pkg": "7.29.3", + "@ecosystem/brands-api": "1.33.0", + "@ecosystem/export-api": "^1.16.0", + "@ecosystem/export-utils": "1.1.0", + "@ecosystem/formatters": "2.0.0", + "@ecosystem/market-context-selection": "1.0.247", + "@ecosystem/newron-client-lib": "1.43.17", + "@ecosystem/newron-design-system": "1.27.61", + "@ecosystem/performance-drivers": "1.20.5", + "@ecosystem/preference-nest-api": "2.6.14", + "@ecosystem/ui-lib": "11.8.1", + "@ecosystem/upsell-modules": "2.2.0", + "@fortawesome/fontawesome-svg-core": "^1.2.22", + "@fortawesome/free-solid-svg-icons": "^5.10.2", + "@fortawesome/react-fontawesome": "^0.1.4", + "@segment/in-eu": "^0.3.0", + "apollo-client": "^2.6.4", + "autobind": "^1.0.3", + "axios": "^0.19.0", + "connected-react-router": "6.4.0", + "core-js": "3.2.1", + "currency-symbol-map": "^5.1.0", + "cypress-grep": "^2.13.1", + "cypress-real-events": "^1.4.0", + "date-fns": "^2.3.0", + "debounce": "^1.2.0", + "ecosystem-api": "*", + "file-saver": "^2.0.5", + "graphql": "15.5", + "highcharts": "^9.3.2", + "highcharts-react-official": "^3.0.0", + "history": "^4.9.0", + "intro.js": "^6.0.0", + "intro.js-react": "^0.7.0", + "jest-runner-groups": "^2.1.0", + "json2csv": "^5.0.7", + "junit2json": "^3.0.0", + "jwt-decode": "^3.1.2", + "moment": "^2.24.0", + "nock": "^13.2.1", + "normalize.css": "^8.0.1", + "query-string": "^6.13.2", + "react": "^16.14.0", + "react-apollo": "^2.5.6", + "react-dom": "npm:@hot-loader/react-dom", + "react-hot-loader": "^4.12.12", + "react-outside-click-handler": "^1.3.0", + "react-query": "^3.24.4", + "react-redux": "^7.2.8", + "react-router-dom": "^5.2.0", + "react-select": "4.3.1", + "recharts": "^1.7.1", + "redux": "^4.0.4", + "redux-localstorage": "^v1.0.0-rc4", + "redux-localstorage-filter": "^0.1.1", + "redux-thunk": "^2.3.0", + "reselect": "^4.1.5", + "sanitize-html": "^1.27.0", + "ts-node": "^10.7.0", + "ulid": "^2.3.0", + "use-query-params": "^1.2.3" + }, + "devDependencies": { + "@babel/core": "^7.12.9", + "@babel/plugin-proposal-class-properties": "^7.5.5", + "@babel/plugin-proposal-decorators": "^7.6.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1", + "@babel/plugin-proposal-object-rest-spread": "^7.5.5", + "@babel/plugin-proposal-optional-chaining": "^7.9.0", + "@babel/plugin-syntax-import-meta": "^7.2.0", + "@babel/plugin-transform-runtime": "^7.13.15", + "@babel/polyfill": "^7.6.0", + "@babel/preset-env": "^7.12.7", + "@babel/preset-react": "^7.12.7", + "@babel/preset-typescript": "^7.12.7", + "@babel/register": "^7.6.0", + "@svgr/webpack": "5.5.0", + "@testing-library/dom": "^7.28.1", + "@testing-library/jest-dom": "^5.11.6", + "@testing-library/react": "^11.0.4", + "@testing-library/react-hooks": "^3.4.1", + "@testing-library/user-event": "^12.2.2", + "@types/classnames": "^2.2.9", + "@types/dateformat": "^3.0.1", + "@types/debounce": "^1.2.0", + "@types/dotenv": "^6.1.1", + "@types/file-saver": "^2.0.1", + "@types/graphql": "^14.5.0", + "@types/history": "^4.7.3", + "@types/intro.js": "^5.1.0", + "@types/jest": "^26.0.0", + "@types/jest-when": "2.7.2", + "@types/jwt-decode": "^2.2.1", + "@types/node": "12.7.4", + "@types/react": "^17.0.4", + "@types/react-intl": "^3.0.0", + "@types/react-outside-click-handler": "^1.3.0", + "@types/react-redux": "^7.1.2", + "@types/react-router-dom": "^5.3.3", + "@types/react-select": "3.0.8", + "@types/react-test-renderer": "^16.9.0", + "@types/recharts": "^1.1.21", + "@types/redux": "^3.6.0", + "@types/redux-localstorage": "^1.0.8", + "@types/redux-localstorage-filter": "^0.1.4", + "@types/sanitize-html": "^1.23.3", + "@types/systemjs": "^6.1.0", + "@types/webpack-env": "^1.16.0", + "awesome-typescript-loader": "^5.2.1", + "babel-core": "^7.0.0-bridge.0", + "babel-loader": "^8.0.6", + "body-parser": "^1.19.0", + "classnames": "^2.2.6", + "clean-webpack-plugin": "^3.0.0", + "cross-env": "^7.0.3", + "css-loader": "^3.2.0", + "cypress": "9.6.0", + "cypress-localstorage-commands": "^1.7.0", + "cypress-multi-reporters": "^1.5.0", + "cypress-xpath": "^1.4.0", + "dateformat": "^3.0.3", + "dotenv": "^8.1.0", + "dotenv-defaults": "^1.1.1", + "dotenv-webpack": "^1.7.0", + "exceljs": "^4.2.1", + "express": "^4.17.1", + "file-loader": "^6.2.0", + "identity-obj-proxy": "^3.0.0", + "jest": "^26.6.1", + "jest-chance": "^0.1.7", + "jest-junit": "^8.0.0", + "jest-localstorage-mock": "^2.4.0", + "jest-raw-loader": "^1.0.1", + "jest-when": "^3.0.1", + "jwt-decode": "^3.1.2", + "mini-css-extract-plugin": "^1.6.0", + "mocha": "^9.2.2", + "mochawesome": "^7.1.3", + "mochawesome-merge": "^4.2.1", + "mochawesome-report-generator": "^6.2.0", + "mock-apollo-client": "^1.0.0", + "msw": "^0.39.2", + "node-sass": "^6.0.1", + "optimize-css-assets-webpack-plugin": "^5.0.3", + "postcss-loader": "^3.0.0", + "postcss-preset-env": "^6.7.0", + "prettier": "^2.8.4", + "process": "^0.11.10", + "raw-loader": "^3.1.0", + "react-select-event": "^5.1.0", + "react-test-renderer": "^16.9.0", + "redux-devtools-extension": "^2.13.8", + "sass-loader": "^12.3.0", + "single-spa-css": "^1.1.2", + "single-spa-react": "^4.1.1", + "style-loader": "^0.23.1", + "stylelint": "^13.2.0", + "stylelint-declaration-use-variable": "^1.7.2", + "stylelint-order": "^3.1.0", + "stylelint-scss": "^3.10.1", + "stylelint-webpack-plugin": "^2.0.0", + "ts-config-single-spa": "^2.0.1", + "ts-jest": "^26.5.6", + "ts-loader": "^6.0.4", + "typescript": "4.8.4", + "url-loader": "^2.1.0", + "webpack": "^5.8.0", + "webpack-cli": "^4.2.0", + "webpack-config-single-spa-react": "2.2.2", + "webpack-config-single-spa-react-ts": "2.2.2", + "webpack-config-single-spa-ts": "^3.0.0", + "webpack-dev-server": "^4.0.0-beta.3", + "webpack-graphql-loader": "^1.0.2", + "webpack-merge": "^5.4.0", + "webpack-modules": "^1.0.0", + "whatwg-fetch": "^3.6.2", + "write-pkg": "^4.0.0", + "yarn": "^1.17.3" + } +} From 14b611ad62e19d15f853be6a824627d95ca1f052 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 10:17:28 +0000 Subject: [PATCH 45/50] quick-commit - Fri 12/01/2023 10:17:27 --- .github/workflows/cd.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index d6e3804..572e2ed 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -13,6 +13,8 @@ jobs: runs-on: ubuntu-latest continue-on-error: true steps: + - name: Checkout + uses: actions/checkout@v3 - id: set_var run: | content=`cat ./package.json` From bca676a9e807994995ab0b28a422ae6338410293 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 10:27:20 +0000 Subject: [PATCH 46/50] quick-commit - Fri 12/01/2023 10:27:20 --- .github/workflows/cd.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 572e2ed..d0bb5b1 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -31,10 +31,17 @@ jobs: version: runs-on: ubuntu-latest continue-on-error: true - env: - STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include }} steps: - - name: Get version + - name: Get version1 + env: + STAGE_DEV: ${{ vars.STAGE_DEV }} + shell: bash + run: | + echo "STAGE_DEV=$STAGE_DEV" + + - name: Get version2 + env: + STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include }} shell: bash run: | echo "STAGE_DEV=$STAGE_DEV" From 99cab5f984ef4c7aa9cb843660a76d8b54a30048 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 10:39:27 +0000 Subject: [PATCH 47/50] quick-commit - Fri 12/01/2023 10:39:27 --- .github/workflows/cd.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index d0bb5b1..4415ab1 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -40,11 +40,11 @@ jobs: echo "STAGE_DEV=$STAGE_DEV" - name: Get version2 - env: - STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include }} + #env: + # STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include }} shell: bash run: | - echo "STAGE_DEV=$STAGE_DEV" + echo "STAGE_DEV=${{ fromJson(vars.STAGE_DEV).include }}" # fastfeedback: # uses: ./.github/workflows/external-workflow-fastfeedback.yaml # From f5b9e9da4033c705941180ad4a3c3dd0cf2b0c90 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 11:36:27 +0000 Subject: [PATCH 48/50] quick-commit - Fri 12/01/2023 11:36:27 --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 4415ab1..9665a5b 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -44,7 +44,7 @@ jobs: # STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include }} shell: bash run: | - echo "STAGE_DEV=${{ fromJson(vars.STAGE_DEV).include }}" + echo "STAGE_DEV=${{ fromJson(vars.STAGE_DEV).include[0] }}" # fastfeedback: # uses: ./.github/workflows/external-workflow-fastfeedback.yaml # From 028541da95c7b1ad0bad6f0768af9e804ab03b23 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 11:37:39 +0000 Subject: [PATCH 49/50] quick-commit - Fri 12/01/2023 11:37:39 --- .github/workflows/cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 9665a5b..b5a4bbb 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -44,7 +44,7 @@ jobs: # STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include }} shell: bash run: | - echo "STAGE_DEV=${{ fromJson(vars.STAGE_DEV).include[0] }}" + echo "STAGE_DEV=${{ fromJson(vars.STAGE_DEV).include[0]['deploy_env'] }}" # fastfeedback: # uses: ./.github/workflows/external-workflow-fastfeedback.yaml # From 2861d5114db45c10c88f38a84c2d497e5341567d Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Fri, 1 Dec 2023 11:39:11 +0000 Subject: [PATCH 50/50] quick-commit - Fri 12/01/2023 11:39:11 --- .github/workflows/cd.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index b5a4bbb..46d62a6 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -40,10 +40,11 @@ jobs: echo "STAGE_DEV=$STAGE_DEV" - name: Get version2 - #env: - # STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include }} + env: + STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include[0]['deploy_env'] }} shell: bash run: | + echo "STAGE_DEV=$STAGE_DEV" echo "STAGE_DEV=${{ fromJson(vars.STAGE_DEV).include[0]['deploy_env'] }}" # fastfeedback: # uses: ./.github/workflows/external-workflow-fastfeedback.yaml