Skip to content

Commit

Permalink
Merge pull request #527 from 18F/mgwalker/fix-dev-deploy
Browse files Browse the repository at this point in the history
Fix dev deploy
  • Loading branch information
mgwalker authored Feb 27, 2024
2 parents 4cf19a3 + 1e5821b commit 9a88566
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/reusable_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,22 @@ jobs:
- name: add extra deployment steps for dev
id: devSteps
if: ${{ inputs.environment == 'dev' }}
run: echo 'command="cf create-service aws-rds micro-psql charlie-brain; bash .github/workflows/wait-for-database.sh"' >> "$GITHUB_OUTPUT"
env:
CF_API: ${{ secrets.CF_API }}
CF_ORG: ${{ secrets.CF_ORG }}
CF_PASSWORD: ${{ secrets.CF_PASSWORD }}
CF_SPACE: ${{ inputs.environment }}
CF_USERNAME: ${{ secrets.CF_USERNAME }}
run: |
cf login -a $CF_API -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE
cf create-service aws-rds micro-psql charlie-brain
STATUS="$(cf service charlie-brain | grep " status:" | awk -F ":" '{print $2}' | xargs)"
while [ "$STATUS" != "create succeeded" ]
do
echo "Waiting for database service to be ready..."
sleep 10
STATUS="$(cf service charlie-brain | grep " status:" | awk -F ":" '{print $2}' | xargs echo)"
done
- name: push to cloud.gov
env:
CF_API: ${{ secrets.CF_API }}
Expand All @@ -39,5 +54,4 @@ jobs:
CF_USERNAME: ${{ secrets.CF_USERNAME }}
run: |
cf login -a $CF_API -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE
${{ steps.devSteps.outputs.command }}
cf push -f manifest.yml --vars-file ./${{ inputs.environment }}.yml
9 changes: 0 additions & 9 deletions .github/workflows/wait-for-database.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/brain.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const set = async (key, value) => {
};

const initialize = async (config = process.env) => {
client = new Client({ connectionString: config.DATABASE_URL });
client = new Client({ connectionString: config.DATABASE_URL, ssl: true });
await client.connect();

await client.query(
Expand Down

0 comments on commit 9a88566

Please sign in to comment.