Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Review Apps on CPL Gem on ControlPlane #584

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
test error handling
  • Loading branch information
justin808 committed Mar 25, 2024
commit e1aa3fc7284165ac49f47479c33e3650644e10c3
2 changes: 1 addition & 1 deletion .controlplane/controlplane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ aliases:
# Production apps will use a different org than staging for security.
# Change this value to your org name
# or set ENV CPLN_ORG to your org name as that will override whatever is used here for all cpl commands
# cpln_org: shakacode-open-source-examples
cpln_org: shakacode-open-source-examples-staging

# Example apps use only location. CPLN offers the ability to use multiple locations.
default_location: aws-us-east-2
Expand Down
25 changes: 21 additions & 4 deletions .controlplane/release_script.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
#!/bin/bash -e

echo 'Running release_script.sh per controlplane.yml'

echo 'Run DB migrations'
./bin/rails db:prepare
log() {
echo "[`date +%Y-%m-%d:%H:%M:%S`]: $1"
}

echo 'Completed release_script.sh per controlplane.yml'
error_exit() {
log "$1" 1>&2
exit 1
}

# Test error!
error_exit

log 'Running release_script.sh per controlplane.yml'

if [ -x ./bin/rails ]; then
log 'Run DB migrations'
./bin/rails db:prepare || error_exit "Failed to run DB migrations"
else
error_exit "./bin/rails does not exist or is not executable"
fi

log 'Completed release_script.sh per controlplane.yml'
Loading