Skip to content

Commit 751eb87

Browse files
committed
handle calling cpflow setup for new app
1 parent 180ee90 commit 751eb87

File tree

4 files changed

+192
-97
lines changed

4 files changed

+192
-97
lines changed

.github/actions/deploy-to-control-plane/scripts/delete-app.sh

-36
This file was deleted.

.github/actions/deploy-to-control-plane/scripts/deploy.sh

+6-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Must be a positive integer
1212
#
1313
# Outputs:
14-
# - rails_url: URL of the deployed Rails application
14+
# - ENV APP_URL: URL of the deployed application
1515

1616
set -e
1717

@@ -39,11 +39,9 @@ if ! timeout "${WAIT_TIMEOUT}" cpflow deploy-image -a "$APP_NAME" --run-release-
3939
fi
4040

4141
# Extract app URL from deployment output
42-
RAILS_URL=$(grep -oP 'https://rails-[^[:space:]]*\.cpln\.app(?=\s|$)' "$TEMP_OUTPUT" | head -n1)
43-
if [ -z "$RAILS_URL" ]; then
44-
echo "❌ Failed to get app URL from deployment output"
45-
echo "Full output:"
46-
cat "$TEMP_OUTPUT"
42+
APP_URL=$(grep -oP 'https://[^[:space:]]*\.cpln\.app(?=\s|$)' "$TEMP_OUTPUT" | head -n1)
43+
if [ -z "$APP_URL" ]; then
44+
echo "❌ Error: Could not find app URL in deployment output"
4745
exit 1
4846
fi
4947

@@ -62,5 +60,5 @@ if ! timeout "${WAIT_TIMEOUT}" bash -c "cpflow ps:wait -a \"$APP_NAME\"" 2>&1 |
6260
fi
6361

6462
echo "✅ Deployment successful"
65-
echo "🌐 Rails URL: $RAILS_URL"
66-
echo "rails_url=$RAILS_URL" >> "$GITHUB_OUTPUT"
63+
echo "🌐 App URL: $APP_URL"
64+
echo "APP_URL=$APP_URL" >> "$GITHUB_OUTPUT"

.github/workflows/debug-workflow.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Debug Workflow Information
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
debug_enabled:
7+
required: false
8+
type: boolean
9+
default: false
10+
description: 'Enable debug logging (defaults to false)'
11+
12+
jobs:
13+
debug-info:
14+
runs-on: ubuntu-latest
15+
if: inputs.debug_enabled || vars.DEBUG_WORKFLOW == 'true'
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Log Branch Info
22+
run: |
23+
echo "Branch for this run:"
24+
if [ "${{ github.event_name }}" == "pull_request" ]; then
25+
echo "Pull Request Source Branch: ${{ github.head_ref }}"
26+
else
27+
echo "Branch: ${{ github.ref_name }}"
28+
fi
29+
30+
- name: Debug GitHub Context
31+
run: |
32+
echo "Event name: ${{ github.event_name }}"
33+
echo "Event path: ${{ github.event_path }}"
34+
echo "Repository: ${{ github.repository }}"
35+
echo "Full GitHub context:"
36+
echo '${{ toJson(github) }}'

0 commit comments

Comments
 (0)