Skip to content

Commit

Permalink
Test review apps creation alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisfreitag committed Aug 7, 2024
1 parent e46aa9e commit 034530b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/review-app-creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,25 @@ jobs:
- name: 🗃 Create database addon
run: |
$CLEVER_CLI addon create postgresql-addon $REVIEW_APP_DB_NAME --org itou_review_apps --plan xxs_sml --yes --addon-version 15
$CLEVER_CLI service link-addon $REVIEW_APP_DB_NAME
echo "DATABASE_ADDON_ID=$($CLEVER_CLI addon list --format=json --org itou_review_apps | jq --raw-output '.[] | select(.name == "$REVIEW_APP_NAME") | .addonId')" >> "$GITHUB_ENV"
{
echo 'DATABASE_ENV<<EOF'
$CLEVER_CLI addon env $DATABASE_ADDON_ID --org itou_review_apps
echo EOF
} >> "$GITHUB_ENV"
- name: Wait for database addon to be up
run: >
ATTEMPT=0;
until $(psql $POSTGRESQL_ADDON_URI --command='SELECT 1') || (( $ATTEMPT >= 180 ));
do
let ATTEMPT++;
echo "Waiting for database connection… [$ATTEMPT]";
sleep 1;
done
- name: Link database to addon
run: $CLEVER_CLI service link-addon $REVIEW_APP_DB_NAME

- name: 🤝 Link addons & add environment variables
run: |
Expand Down

0 comments on commit 034530b

Please sign in to comment.