From c90a2d80b091c8ba63bed0fe2816a8d915c4fa34 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 30 Apr 2025 18:37:57 -0500 Subject: [PATCH 1/9] bump --- client/app/bundles/comments/components/Footer/Footer.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/bundles/comments/components/Footer/Footer.jsx b/client/app/bundles/comments/components/Footer/Footer.jsx index 61c66df8..2cb65281 100644 --- a/client/app/bundles/comments/components/Footer/Footer.jsx +++ b/client/app/bundles/comments/components/Footer/Footer.jsx @@ -14,7 +14,7 @@ export default class Footer extends BaseComponent {
- Rails On Maui on X + Rails On Maui on X (Twitter)
From 50865e2f19cbd1207cb8f9918f03fdac9389d885 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 30 Apr 2025 18:41:17 -0500 Subject: [PATCH 2/9] again --- client/app/bundles/comments/components/Footer/Footer.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/bundles/comments/components/Footer/Footer.jsx b/client/app/bundles/comments/components/Footer/Footer.jsx index 2cb65281..94e98162 100644 --- a/client/app/bundles/comments/components/Footer/Footer.jsx +++ b/client/app/bundles/comments/components/Footer/Footer.jsx @@ -14,7 +14,7 @@ export default class Footer extends BaseComponent {
- Rails On Maui on X (Twitter) + Rails On Maui on Twitter
From abd25308bd41c7f09637474d76a3069db5c49093 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 30 Apr 2025 18:53:47 -0500 Subject: [PATCH 3/9] try sleep --- .github/workflows/deploy-to-control-plane-review-app.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-to-control-plane-review-app.yml b/.github/workflows/deploy-to-control-plane-review-app.yml index 16c3e185..3c5e3f56 100644 --- a/.github/workflows/deploy-to-control-plane-review-app.yml +++ b/.github/workflows/deploy-to-control-plane-review-app.yml @@ -111,13 +111,11 @@ jobs: fi # Check if app exists and save state - if ! cpflow exists -a ${{ env.APP_NAME }}; then + if cpflow exists -a ${{ env.APP_NAME }}; then if [[ "${{ github.event_name }}" == "pull_request" ]]; then - exit 0 + echo "Canceling job as review app has not been previously deployed."; sleep inf fi echo "APP_EXISTS=false" >> $GITHUB_ENV - else - echo "APP_EXISTS=true" >> $GITHUB_ENV fi - name: Validate Deployment Request From ab2be70ed35e07f7dd5d5fc388f689de3e8f79bc Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 30 Apr 2025 19:04:13 -0500 Subject: [PATCH 4/9] debug --- .github/workflows/deploy-to-control-plane-review-app.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-to-control-plane-review-app.yml b/.github/workflows/deploy-to-control-plane-review-app.yml index 3c5e3f56..f353525c 100644 --- a/.github/workflows/deploy-to-control-plane-review-app.yml +++ b/.github/workflows/deploy-to-control-plane-review-app.yml @@ -111,10 +111,13 @@ jobs: fi # Check if app exists and save state + echo (cpflow exists -a ${{ env.APP_NAME }}) if cpflow exists -a ${{ env.APP_NAME }}; then + echo "review app does not exist!" if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo "Canceling job as review app has not been previously deployed."; sleep inf fi + echo "APP_EXISTS=false" echo "APP_EXISTS=false" >> $GITHUB_ENV fi From 787a216b578ab8b36856ed824c9a9c724e6083d9 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 30 Apr 2025 19:13:20 -0500 Subject: [PATCH 5/9] fix --- .github/workflows/deploy-to-control-plane-review-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-to-control-plane-review-app.yml b/.github/workflows/deploy-to-control-plane-review-app.yml index f353525c..fca66da5 100644 --- a/.github/workflows/deploy-to-control-plane-review-app.yml +++ b/.github/workflows/deploy-to-control-plane-review-app.yml @@ -111,7 +111,7 @@ jobs: fi # Check if app exists and save state - echo (cpflow exists -a ${{ env.APP_NAME }}) + echo "$(cpflow exists -a ${{ env.APP_NAME }})" if cpflow exists -a ${{ env.APP_NAME }}; then echo "review app does not exist!" if [[ "${{ github.event_name }}" == "pull_request" ]]; then From 78b497d198c737f161b753bc883ef27d44466317 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 30 Apr 2025 19:22:34 -0500 Subject: [PATCH 6/9] more --- .github/workflows/deploy-to-control-plane-review-app.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-to-control-plane-review-app.yml b/.github/workflows/deploy-to-control-plane-review-app.yml index fca66da5..43f3b8ad 100644 --- a/.github/workflows/deploy-to-control-plane-review-app.yml +++ b/.github/workflows/deploy-to-control-plane-review-app.yml @@ -111,8 +111,9 @@ jobs: fi # Check if app exists and save state + echo "apple" echo "$(cpflow exists -a ${{ env.APP_NAME }})" - if cpflow exists -a ${{ env.APP_NAME }}; then + if [[ cpflow exists -a ${{ env.APP_NAME }} ]]; then echo "review app does not exist!" if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo "Canceling job as review app has not been previously deployed."; sleep inf @@ -120,6 +121,7 @@ jobs: echo "APP_EXISTS=false" echo "APP_EXISTS=false" >> $GITHUB_ENV fi + echo "bananas" - name: Validate Deployment Request id: validate From 7e7f3cf1d2e27da61c8619201d668459efde1926 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 30 Apr 2025 19:26:32 -0500 Subject: [PATCH 7/9] maybe --- .github/workflows/deploy-to-control-plane-review-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-control-plane-review-app.yml b/.github/workflows/deploy-to-control-plane-review-app.yml index 43f3b8ad..5f58b679 100644 --- a/.github/workflows/deploy-to-control-plane-review-app.yml +++ b/.github/workflows/deploy-to-control-plane-review-app.yml @@ -112,8 +112,8 @@ jobs: # Check if app exists and save state echo "apple" - echo "$(cpflow exists -a ${{ env.APP_NAME }})" - if [[ cpflow exists -a ${{ env.APP_NAME }} ]]; then + echo [ cpflow exists -a ${{ env.APP_NAME }} ] + if [ cpflow exists -a ${{ env.APP_NAME }} ]; then echo "review app does not exist!" if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo "Canceling job as review app has not been previously deployed."; sleep inf From 9e141d96ba8b5afbc83d0b90880291fd25788e69 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 30 Apr 2025 19:34:16 -0500 Subject: [PATCH 8/9] again --- .github/workflows/deploy-to-control-plane-review-app.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-control-plane-review-app.yml b/.github/workflows/deploy-to-control-plane-review-app.yml index 5f58b679..85669e49 100644 --- a/.github/workflows/deploy-to-control-plane-review-app.yml +++ b/.github/workflows/deploy-to-control-plane-review-app.yml @@ -112,8 +112,9 @@ jobs: # Check if app exists and save state echo "apple" - echo [ cpflow exists -a ${{ env.APP_NAME }} ] - if [ cpflow exists -a ${{ env.APP_NAME }} ]; then + echo "NoBrace: $(cpflow exists -a ${{ env.APP_NAME }})" + echo "Brace: $([ cpflow exists -a ${{ env.APP_NAME }} ])" + if ! cpflow exists -a ${{ env.APP_NAME }}; then echo "review app does not exist!" if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo "Canceling job as review app has not been previously deployed."; sleep inf From bb2f1c0bc1ae4809264d4abd05ecaa12cd5d7d3a Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 30 Apr 2025 20:57:06 -0500 Subject: [PATCH 9/9] fixes --- .../deploy-to-control-plane-review-app.yml | 68 ++++--------------- 1 file changed, 14 insertions(+), 54 deletions(-) diff --git a/.github/workflows/deploy-to-control-plane-review-app.yml b/.github/workflows/deploy-to-control-plane-review-app.yml index 85669e49..63b5209e 100644 --- a/.github/workflows/deploy-to-control-plane-review-app.yml +++ b/.github/workflows/deploy-to-control-plane-review-app.yml @@ -111,74 +111,26 @@ jobs: fi # Check if app exists and save state - echo "apple" - echo "NoBrace: $(cpflow exists -a ${{ env.APP_NAME }})" - echo "Brace: $([ cpflow exists -a ${{ env.APP_NAME }} ])" if ! cpflow exists -a ${{ env.APP_NAME }}; then - echo "review app does not exist!" if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "Canceling job as review app has not been previously deployed."; sleep inf + echo "Canceling job as review app has not been previously deployed." fi - echo "APP_EXISTS=false" echo "APP_EXISTS=false" >> $GITHUB_ENV - fi - echo "bananas" - - - name: Validate Deployment Request - id: validate - run: | - # Skip validation if deployment is already disabled - if [[ "${{ env.DO_DEPLOY }}" == "false" ]]; then - echo "Skipping validation - deployment already disabled" - exit 0 - fi - - if ! [[ "${{ github.event_name }}" == "workflow_dispatch" || \ - "${{ github.event_name }}" == "issue_comment" || \ - "${{ github.event_name }}" == "pull_request" || \ - "${{ github.event_name }}" == "push" ]]; then - echo "Error: Unsupported event type ${{ github.event_name }}" - exit 1 - fi - - # Set DO_DEPLOY based on event type and conditions - if [[ "${{ github.event_name }}" == "pull_request" && \ - ("${{ github.event.action }}" == "opened" || \ - "${{ github.event.action }}" == "synchronize" || \ - "${{ github.event.action }}" == "reopened") ]]; then - echo "DO_DEPLOY=true" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "push" ]]; then - echo "DO_DEPLOY=true" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "DO_DEPLOY=true" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "issue_comment" ]]; then - if [[ "${{ github.event.issue.pull_request }}" ]]; then - # Trim spaces and check for exact command - COMMENT_BODY=$(echo "${{ github.event.comment.body }}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') - if [[ "$COMMENT_BODY" == "/deploy-review-app" ]]; then - echo "DO_DEPLOY=true" >> $GITHUB_ENV - else - echo "DO_DEPLOY=false" >> $GITHUB_ENV - echo "Skipping deployment - comment '$COMMENT_BODY' does not match '/deploy-review-app'" - fi - else - echo "DO_DEPLOY=false" >> $GITHUB_ENV - echo "Skipping deployment for non-PR comment" - fi - fi - if [[ "${{ env.DO_DEPLOY }}" == "false" ]]; then - exit 0 + else + echo "APP_EXISTS=true" >> $GITHUB_ENV fi - name: Setup Control Plane App if Not Existing - if: env.APP_EXISTS == 'false' + if: env.APP_EXISTS == 'false' && github.event_name != 'pull_request' env: CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }} run: | echo "🔧 Setting up new Control Plane app..." cpflow setup-app -a ${{ env.APP_NAME }} --org ${{ vars.CPLN_ORG_STAGING }} + echo "APP_EXISTS=true" >> $GITHUB_ENV - name: Create Initial Comment + if: env.APP_EXISTS == 'true' uses: actions/github-script@v7 id: create-comment with: @@ -192,6 +144,7 @@ jobs: core.setOutput('comment-id', result.data.id); - name: Set Deployment URLs + if: env.APP_EXISTS == 'true' id: set-urls uses: actions/github-script@v7 with: @@ -223,6 +176,7 @@ jobs: ); - name: Initialize GitHub Deployment + if: env.APP_EXISTS == 'true' uses: actions/github-script@v7 id: init-deployment with: @@ -252,6 +206,7 @@ jobs: return deployment.data.id; - name: Update Status - Building + if: env.APP_EXISTS == 'true' uses: actions/github-script@v7 with: script: | @@ -271,6 +226,7 @@ jobs: }); - name: Build Docker Image + if: env.APP_EXISTS == 'true' id: build uses: ./.github/actions/build-docker-image with: @@ -280,6 +236,7 @@ jobs: PR_NUMBER: ${{ env.PR_NUMBER }} - name: Update Status - Deploying + if: env.APP_EXISTS == 'true' uses: actions/github-script@v7 with: script: | @@ -301,13 +258,16 @@ jobs: }); - name: Deploy to Control Plane + if: env.APP_EXISTS == 'true' run: cpflow deploy-image -a ${{ env.APP_NAME }} --run-release-phase --org ${{ vars.CPLN_ORG_STAGING }} --verbose - name: Retrieve App URL + if: env.APP_EXISTS == 'true' id: workload run: echo "WORKLOAD_URL=$(cpln workload get rails --gvc ${{ env.APP_NAME }} | tee | grep -oP 'https://[^[:space:]]*\.cpln\.app(?=\s|$)' | head -n1)" >> "$GITHUB_OUTPUT" - name: Update Status - Deployment Complete + if: env.APP_EXISTS == 'true' uses: actions/github-script@v7 with: script: |