Skip to content

Commit

Permalink
#150 wait for Pantheon deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
beto-aveiga committed Feb 5, 2024
1 parent ee7ef63 commit c855884
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion scaffold/github/actions/pantheon/review/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,27 @@ runs:
run: |
source .github/actions/drainpipe/set-env/bash_aliases
# Wait for Pantheon to sync.
sleep 30
START_TIME=$(date +%s)
TIMEOUT=$((5 * 60)) # 5 minutes in seconds
while true; do
CURRENT_TIME=$(date +%s)
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
# Check if the elapsed time is greater than the timeout
if [[ $ELAPSED_TIME -ge $TIMEOUT ]]; then
echo "Deployment to Pantheon is not ready yet."
exit 1
fi
STATUS=$(drainpipe_exec "terminus workflow:info:status ${{ inputs.site-name }} --fields=status --format=string")
echo "Checking deployment status: $STATUS"
# Check the command output
if [[ $STATUS == "succeeded" ]]; then
break
elif [[ $STATUS != "running" ]]; then
exit 1
fi
sleep 15
done
drainpipe_exec "terminus aliases --only ${{ inputs.site-name }} --yes"
if [ "${{ inputs.run-installer }}" == "true" ]; then
drainpipe_exec "./vendor/bin/drush @${{ inputs.site-name }}.pr-$DRAINPIPE_PR_NUMBER --yes site:install --existing-config"
Expand Down

0 comments on commit c855884

Please sign in to comment.