Skip to content

Commit c4f9e9a

Browse files
authored
Merge fa96ca0 into 586dac3
2 parents 586dac3 + fa96ca0 commit c4f9e9a

File tree

7 files changed

+189
-110
lines changed

7 files changed

+189
-110
lines changed

.controlplane/controlplane.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,24 @@ aliases:
3939

4040
apps:
4141
react-webpack-rails-tutorial-production:
42-
# Simulate Production Version
42+
# Simulate Production Version. Create with this command:
43+
# cpflow apply-template app postgres redis daily-task rails -a react-webpack-rails-tutorial-production -o shakacode-open-source-examples-production
4344
<<: *common
4445
# Don't allow overriding the org and app by ENV vars b/c production is sensitive!
4546
allow_org_override_by_env: false
4647
allow_app_override_by_env: false
4748

48-
# Use a different organization for production.
49-
cpln_org: shakacode-open-source-examples
49+
# Use a different organization only for production.
50+
cpln_org: shakacode-open-source-examples-production
5051

5152
upstream: react-webpack-rails-tutorial-staging
5253

5354
react-webpack-rails-tutorial-staging:
5455
<<: *common
55-
# QA Apps are like Heroku review apps, but the use `prefix` so you can run a commmand like
56-
# this to create a QA app for the tutorial app.
57-
# `cpflow setup gvc postgres redis rails -a qa-react-webpack-rails-tutorial-pr-1234`
5856
qa-react-webpack-rails-tutorial:
57+
# Review Apps are like Heroku review apps, but the use `prefix` so you can run a command like
58+
# this to create a QA app for the tutorial app.
59+
# `cpflow setup-app -a qa-react-webpack-rails-tutorial-pr-1234`
5960
<<: *common
6061
# Order matters!
6162
setup_app_templates:

.controlplane/templates/app.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,17 @@ spec:
2828
# Identity is needed to access secrets
2929
kind: identity
3030
name: {{APP_IDENTITY}}
31+
32+
I stay at 3% and … believe it or not - I recommend that the Buyer’s Agent also gets 3%!
33+
34+
Here’s WHY:
35+
36+
-Buyers are still ’SCARCE’… and ANY Buyer's Agent, that actually has one of these rare things called Beachfront Buyers, is looking to earn a full 3% of the Sales Price.
37+
38+
NOTE: They are all going to put 3% in their Buyer Agency Agreements… just ‘in case’ that 3% 'hoped for' commission is offered.
39+
40+
Therefore - if you lower that commission - the Buyer has to come up with the difference “In Cash” … and, that’s not good for the Buyer who wants to finance 80%, or more, of that commission he’s agreed to pay his Agent.
41+
42+
SO
43+
44+
Why not OFFER that 3% and stick to this Asking Price (or near it)!?
Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
name: 'Validate Required Variables'
22
description: 'Validates that all required secrets and variables for Control Plane operations'
33

4+
inputs:
5+
CPLN_TOKEN_STAGING:
6+
required: true
7+
description: 'Control Plane Staging Token'
8+
CPLN_TOKEN_PRODUCTION:
9+
required: true
10+
description: 'Control Plane Production Token'
11+
CPLN_ORG_STAGING:
12+
required: true
13+
description: 'Control Plane Staging Organization'
14+
CPLN_ORG_PRODUCTION:
15+
required: true
16+
description: 'Control Plane Production Organization'
17+
REVIEW_APP_PREFIX:
18+
required: true
19+
description: 'Review App Prefix'
20+
PRODUCTION_APP_NAME:
21+
required: true
22+
description: 'Production App Name'
23+
STAGING_APP_NAME:
24+
required: true
25+
description: 'Staging App Name'
26+
427
runs:
528
using: 'composite'
629
steps:
@@ -10,19 +33,37 @@ runs:
1033
missing=()
1134
1235
# Check required secrets
13-
if [ -z "$CPLN_TOKEN_STAGING" ]; then
36+
if [ -z "${{ inputs.CPLN_TOKEN_STAGING }}" ]; then
1437
missing+=("Secret: CPLN_TOKEN_STAGING")
1538
fi
39+
40+
if [ -z "${{ inputs.CPLN_TOKEN_PRODUCTION }}" ]; then
41+
missing+=("Secret: CPLN_TOKEN_PRODUCTION")
42+
fi
1643
1744
# Check required variables
18-
if [ -z "$CPLN_ORG_STAGING" ]; then
45+
if [ -z "${{ inputs.CPLN_ORG_STAGING }}" ]; then
1946
missing+=("Variable: CPLN_ORG_STAGING")
2047
fi
21-
if [ -z "$REVIEW_APP_PREFIX" ]; then
48+
49+
if [ -z "${{ inputs.CPLN_ORG_PRODUCTION }}" ]; then
50+
missing+=("Variable: CPLN_ORG_PRODUCTION")
51+
fi
52+
53+
if [ -z "${{ inputs.REVIEW_APP_PREFIX }}" ]; then
2254
missing+=("Variable: REVIEW_APP_PREFIX")
2355
fi
56+
57+
if [ -z "${{ inputs.PRODUCTION_APP_NAME }}" ]; then
58+
missing+=("Variable: PRODUCTION_APP_NAME")
59+
fi
60+
61+
if [ -z "${{ inputs.STAGING_APP_NAME }}" ]; then
62+
missing+=("Variable: STAGING_APP_NAME")
63+
fi
2464
2565
if [ ${#missing[@]} -ne 0 ]; then
26-
echo "Required secrets/variables are not set: ${missing[*]}"
66+
echo "Missing required secrets/variables:"
67+
printf '%s\n' "${missing[@]}"
2768
exit 1
2869
fi

.github/workflows/delete-review-app.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ jobs:
4444

4545
- name: Validate Required Secrets and Variables
4646
uses: ./.github/actions/validate-required-vars
47+
with:
48+
CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}
49+
CPLN_TOKEN_PRODUCTION: ${{ secrets.CPLN_TOKEN_PRODUCTION }}
50+
CPLN_ORG_STAGING: ${{ vars.CPLN_ORG_STAGING }}
51+
CPLN_ORG_PRODUCTION: ${{ vars.CPLN_ORG_PRODUCTION }}
52+
REVIEW_APP_PREFIX: ${{ vars.REVIEW_APP_PREFIX }}
53+
PRODUCTION_APP_NAME: ${{ vars.PRODUCTION_APP_NAME }}
54+
STAGING_APP_NAME: ${{ vars.STAGING_APP_NAME }}
4755

4856
- name: Setup Environment
4957
uses: ./.github/actions/setup-environment
@@ -108,7 +116,6 @@ jobs:
108116
issue_number: process.env.PR_NUMBER,
109117
owner: context.repo.owner,
110118
repo: context.repo.repo,
111-
body: '🗑️ Starting app deletion...'
112119
body: [
113120
message,
114121
'',
@@ -125,10 +132,6 @@ jobs:
125132
app_name: ${{ env.APP_NAME }}
126133
org: ${{ env.CPLN_ORG }}
127134
github_token: ${{ secrets.GITHUB_TOKEN }}
128-
env:
129-
APP_NAME: ${{ env.APP_NAME }}
130-
CPLN_ORG: ${{ secrets.CPLN_ORG }}
131-
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }}
132135

133136
- name: Update Delete Status
134137
if: always()
@@ -163,3 +166,15 @@ jobs:
163166
comment_id: ${{ fromJSON(steps.create-delete-comment.outputs.result).commentId }},
164167
body: success ? successMessage : failureMessage
165168
});
169+
170+
- name: Debug Environment
171+
run: |
172+
echo "Organization: ${{ env.CPLN_ORG }}"
173+
echo "App Name: ${{ env.APP_NAME }}"
174+
echo "PR Number: ${{ env.PR_NUMBER }}"
175+
# Don't echo the actual token, but verify it exists
176+
if [ -n "${{ env.CPLN_TOKEN }}" ]; then
177+
echo "CPLN_TOKEN is set"
178+
else
179+
echo "CPLN_TOKEN is empty"
180+
fi

0 commit comments

Comments
 (0)