From 0322af85dc9e0c48f568adab2571be95d914bf9c Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 18:04:57 -0500 Subject: [PATCH 01/10] update promotion workflow --- .../promote-staging-to-production.yml | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index 041480671..f9ba6a23b 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -14,9 +14,8 @@ jobs: if: github.event.inputs.confirm_promotion == 'promote' env: - APP_NAME: react-webpack-rails-tutorial - CPLN_ORG: ${{ secrets.CPLN_ORG }} - UPSTREAM_TOKEN: ${{ secrets.STAGING_TOKEN }} + APP_NAME: ${{ vars.STAGING_APP_NAME }} + UPSTREAM_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }} steps: - name: Checkout code @@ -25,19 +24,13 @@ jobs: - name: Setup Environment uses: ./.github/actions/setup-environment env: - CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }} + CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_PRODUCTION }} - - name: Promote Staging to Production - id: promote - run: | - echo "🚀 Starting promotion from staging to production..." - - if ! cpflow promote-app-from-upstream -a "${APP_NAME}" -t "${UPSTREAM_TOKEN}" --org "${CPLN_ORG}"; then - echo "❌ Failed to promote staging to production" - exit 1 - fi - - echo "✅ Successfully promoted staging to production" + - name: Copy Image from Staging + run: cpflow copy-image-from-upstream -a "${APP_NAME}" -t "${UPSTREAM_TOKEN}" -v + + - name: Deploy Image to Production + run: cpflow deploy-image -v - name: Create GitHub Release if: success() From 0a6e3fb9f58e44f16fe68d241557433987e4f13a Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 18:41:36 -0500 Subject: [PATCH 02/10] attempt2 --- .github/workflows/promote-staging-to-production.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index f9ba6a23b..2971865e3 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -13,24 +13,21 @@ jobs: runs-on: ubuntu-latest if: github.event.inputs.confirm_promotion == 'promote' - env: - APP_NAME: ${{ vars.STAGING_APP_NAME }} - UPSTREAM_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }} - steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Environment uses: ./.github/actions/setup-environment - env: - CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_PRODUCTION }} + with: + token: ${{ secrets.CPLN_TOKEN_PRODUCTION }} + org: ${{ vars.CPLN_ORG_PRODUCTION }} - name: Copy Image from Staging - run: cpflow copy-image-from-upstream -a "${APP_NAME}" -t "${UPSTREAM_TOKEN}" -v + run: cpflow copy-image-from-upstream -a "${{ vars.STAGING_APP_NAME }}" -t "${{ secrets.CPLN_TOKEN_STAGING }}" -v - name: Deploy Image to Production - run: cpflow deploy-image -v + run: cpflow deploy-image -v --run-release-phase - name: Create GitHub Release if: success() From 2dd25c62eb796c3eba0d93cb10a4df97927abeb5 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 18:46:53 -0500 Subject: [PATCH 03/10] whatever --- .github/workflows/promote-staging-to-production.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index 2971865e3..339288120 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -24,7 +24,7 @@ jobs: org: ${{ vars.CPLN_ORG_PRODUCTION }} - name: Copy Image from Staging - run: cpflow copy-image-from-upstream -a "${{ vars.STAGING_APP_NAME }}" -t "${{ secrets.CPLN_TOKEN_STAGING }}" -v + run: cpflow copy-image-from-upstream -a "${{ vars.STAGING_APP_NAME }}" -t "${{ secrets.CPLN_TOKEN_STAGING }}" --verbose - name: Deploy Image to Production run: cpflow deploy-image -v --run-release-phase From 6cc50d0b7472ca79eab5104aefb04725a7f34041 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 19:03:33 -0500 Subject: [PATCH 04/10] newenv --- .github/workflows/promote-staging-to-production.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index 339288120..e8983eee9 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -20,12 +20,18 @@ jobs: - name: Setup Environment uses: ./.github/actions/setup-environment with: - token: ${{ secrets.CPLN_TOKEN_PRODUCTION }} - org: ${{ vars.CPLN_ORG_PRODUCTION }} + token: ${{ secrets.CPLN_TOKEN_STAGING }} + org: ${{ vars.CPLN_ORG_STAGING }} - name: Copy Image from Staging run: cpflow copy-image-from-upstream -a "${{ vars.STAGING_APP_NAME }}" -t "${{ secrets.CPLN_TOKEN_STAGING }}" --verbose + - name: Setup Environment + uses: ./.github/actions/setup-environment + with: + token: ${{ secrets.CPLN_TOKEN_PRODUCTION }} + org: ${{ vars.CPLN_ORG_PRODUCTION }} + - name: Deploy Image to Production run: cpflow deploy-image -v --run-release-phase From 16b3b8f9f2c41f5b3ef41c955925311493ed29d2 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 21:33:02 -0500 Subject: [PATCH 05/10] attempt3 --- .github/workflows/promote-staging-to-production.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index e8983eee9..817ef6a75 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -17,21 +17,15 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Environment - uses: ./.github/actions/setup-environment - with: - token: ${{ secrets.CPLN_TOKEN_STAGING }} - org: ${{ vars.CPLN_ORG_STAGING }} - - - name: Copy Image from Staging - run: cpflow copy-image-from-upstream -a "${{ vars.STAGING_APP_NAME }}" -t "${{ secrets.CPLN_TOKEN_STAGING }}" --verbose - - name: Setup Environment uses: ./.github/actions/setup-environment with: token: ${{ secrets.CPLN_TOKEN_PRODUCTION }} org: ${{ vars.CPLN_ORG_PRODUCTION }} + - name: Copy Image from Staging + run: cpflow copy-image-from-upstream -a "${{ vars.PRODUCTION_APP_NAME }}" -t "${{ secrets.CPLN_TOKEN_STAGING }}" --verbose --trace + - name: Deploy Image to Production run: cpflow deploy-image -v --run-release-phase From 151110563db90f810e0851d24749ad668473b252 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 21:45:51 -0500 Subject: [PATCH 06/10] try different org --- .controlplane/controlplane.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.controlplane/controlplane.yml b/.controlplane/controlplane.yml index f394fe1cb..74dc15832 100644 --- a/.controlplane/controlplane.yml +++ b/.controlplane/controlplane.yml @@ -46,7 +46,7 @@ apps: allow_app_override_by_env: false # Use a different organization for production. - cpln_org: shakacode-open-source-examples + cpln_org: shakacode-open-source-examples-production upstream: react-webpack-rails-tutorial-staging From 82920b63c636f9a650764ee4607f855ffe5e2cc6 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 21:57:23 -0500 Subject: [PATCH 07/10] maybefinal --- .github/workflows/promote-staging-to-production.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index 817ef6a75..ee22b730e 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -24,10 +24,10 @@ jobs: org: ${{ vars.CPLN_ORG_PRODUCTION }} - name: Copy Image from Staging - run: cpflow copy-image-from-upstream -a "${{ vars.PRODUCTION_APP_NAME }}" -t "${{ secrets.CPLN_TOKEN_STAGING }}" --verbose --trace + run: cpflow copy-image-from-upstream -a "${{ vars.PRODUCTION_APP_NAME }}" -t "${{ secrets.CPLN_TOKEN_STAGING }}" - name: Deploy Image to Production - run: cpflow deploy-image -v --run-release-phase + run: cpflow deploy-image --run-release-phase - name: Create GitHub Release if: success() From 5658709e10d6f212774021d2dcede5f06e4bf18a Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 23:42:48 -0500 Subject: [PATCH 08/10] fix deploy-image --- .github/workflows/promote-staging-to-production.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index ee22b730e..87cc4ea15 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -24,10 +24,10 @@ jobs: org: ${{ vars.CPLN_ORG_PRODUCTION }} - name: Copy Image from Staging - run: cpflow copy-image-from-upstream -a "${{ vars.PRODUCTION_APP_NAME }}" -t "${{ secrets.CPLN_TOKEN_STAGING }}" + run: cpflow copy-image-from-upstream -a ${{ vars.PRODUCTION_APP_NAME }} -t "{{ secrets.CPLN_TOKEN_STAGING }} - name: Deploy Image to Production - run: cpflow deploy-image --run-release-phase + run: cpflow deploy-image -a ${{ vars.PRODUCTION_APP_NAME }} --run-release-phase --org ${{ vars.CPLN_ORG_PRODUCTION }} - name: Create GitHub Release if: success() From c9756d0fcb10f1987bf051d63946eb69870d6d1e Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 23:52:07 -0500 Subject: [PATCH 09/10] missed a quote --- .github/workflows/promote-staging-to-production.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index 87cc4ea15..ab6df197e 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -24,7 +24,7 @@ jobs: org: ${{ vars.CPLN_ORG_PRODUCTION }} - name: Copy Image from Staging - run: cpflow copy-image-from-upstream -a ${{ vars.PRODUCTION_APP_NAME }} -t "{{ secrets.CPLN_TOKEN_STAGING }} + run: cpflow copy-image-from-upstream -a ${{ vars.PRODUCTION_APP_NAME }} -t {{ secrets.CPLN_TOKEN_STAGING }} - name: Deploy Image to Production run: cpflow deploy-image -a ${{ vars.PRODUCTION_APP_NAME }} --run-release-phase --org ${{ vars.CPLN_ORG_PRODUCTION }} From 2adceda1ddc3c07e968cade9adeeaf3c8b49291f Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Thu, 20 Mar 2025 23:57:12 -0500 Subject: [PATCH 10/10] help --- .github/workflows/promote-staging-to-production.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index ab6df197e..b06dc044c 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -24,7 +24,7 @@ jobs: org: ${{ vars.CPLN_ORG_PRODUCTION }} - name: Copy Image from Staging - run: cpflow copy-image-from-upstream -a ${{ vars.PRODUCTION_APP_NAME }} -t {{ secrets.CPLN_TOKEN_STAGING }} + run: cpflow copy-image-from-upstream -a ${{ vars.PRODUCTION_APP_NAME }} -t ${{ secrets.CPLN_TOKEN_STAGING }} - name: Deploy Image to Production run: cpflow deploy-image -a ${{ vars.PRODUCTION_APP_NAME }} --run-release-phase --org ${{ vars.CPLN_ORG_PRODUCTION }}