Skip to content

Commit

Permalink
move wait inline
Browse files Browse the repository at this point in the history
  • Loading branch information
mgwalker committed Feb 27, 2024
1 parent 4cf19a3 commit 3e72b23
Showing 1 changed file with 16 additions and 2 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)
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

0 comments on commit 3e72b23

Please sign in to comment.