Skip to content

Commit

Permalink
Issue #336: Allow site environment to be parameterized in pantheon:fe…
Browse files Browse the repository at this point in the history
…tch-db.
  • Loading branch information
alexanderpatriciop committed May 27, 2024
1 parent 0d15f38 commit 8f96361
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/pantheon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ tasks:
desc: "Fetches a database from Pantheon"
env:
DB_DIR: '{{default "/var/www/html/files/db" .DB_DIR}}'
SITE_ENV: '{{default "live" .SITE_ENV}}'
cmds:
- rm -f $DB_DIR/db.sql.gz $DB_DIR/db.sql
- if [ -z "$PANTHEON_TOKEN" ]; then echo "PANTHEON_TOKEN is empty, please add it to your .env file"; exit 1; fi
- echo "⚡ Authorising with Pantheon"
- terminus auth:login --machine-token="${PANTHEON_TOKEN}"
- echo "⚡ Fetching database from Pantheon"
- terminus backup:get {{.PANTHEON_SITE_ID}}.live --element=db --to=$DB_DIR/db.sql.gz
- terminus backup:get {{.PANTHEON_SITE_ID}}.$SITE_ENV --element=db --to=$DB_DIR/db.sql.gz

0 comments on commit 8f96361

Please sign in to comment.