From 0dbcdce592d7b25d57744f87b8f51a5141e9c46d Mon Sep 17 00:00:00 2001 From: Jacob Brewer Date: Sun, 20 Oct 2024 09:13:38 +0100 Subject: [PATCH] Updating cicd --- .github/workflows/database-migrations.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/database-migrations.yml b/.github/workflows/database-migrations.yml index 14e7da4..f7b42aa 100644 --- a/.github/workflows/database-migrations.yml +++ b/.github/workflows/database-migrations.yml @@ -62,11 +62,14 @@ jobs: chmod +x vaultdb mv vaultdb /usr/local/bin - export DATABASE_URL=$(vaultdb -addr="${{ secrets.VAULT_ADDR }}" -user="${{ secrets.VAULT_USER }}" -pass="${{ secrets.VAULT_PASS }}" -path="${{ secrets.VAULT_PATH }}" -host="${{ secrets.DATABASE_HOST }}" -schema="${{ secrets.DATABASE_SCHEMA }}") - if [ "${{ DATABASE_URL }}" == "" ]; then + DATABASE_URL=$(vaultdb -addr="${{ secrets.VAULT_ADDR }}" -user="${{ secrets.VAULT_USER }}" -pass="${{ secrets.VAULT_PASS }}" -path="${{ secrets.VAULT_PATH }}" -host="${{ secrets.DATABASE_HOST }}" -schema="${{ secrets.DATABASE_SCHEMA }}") + if [ "$DATABASE_URL" == "" ]; then echo "Failed to authenticate with Vault. Exiting..." exit 1 fi + + # Set the DATABASE_URL environment variable + echo "DATABASE_URL=$DATABASE_URL" >> $GITHUB_ENV fi echo "DATABASE_URL is set. Continuing..." @@ -88,7 +91,7 @@ jobs: rm -f /usr/local/bin/goschema rm -f /usr/local/bin/vaultdb - if [ "${{ secrets.DATABASE_URL }}" == "" ]; then + if [ "${{ env.DATABASE_URL }}" == "" ]; then unset DATABASE_URL fi