Skip to content

Commit c6e77aa

Browse files
committed
refresh content from any environment
1 parent c1bc2cb commit c6e77aa

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ To see a list of available commands, run `uceap` in the terminal. You can also r
1717

1818
I frequently invoke `uceap refresh-content` to reset my local environment after switching branches. It runs `composer install` and invokes `db-rebuild.sh` with a fresh copy of the latest snapshot of the dev environment database and files. With shell completions installed, it's as easy as `uce<TAB>r<TAB>`.
1919

20+
Troubleshooting an issue on the live site? `TERMINUS_ENV=live uceap refresh-content` will pull the latest backup of the database and files from LIVE. _You'll be knee-deep in PII in no time!_ **Be sure to reset your database and files with DEV data as soon as you're done.**
21+
2022
> 👉 When working on a PR that adds update hooks or makes config changes, it's generally a good idea to make sure it applies cleanly to a database matching the QA environment. To do this, switch to the `qa` branch, run refresh-content, switch back to your branch, and run the deploy command (e.g. `drush md` for the portal):
2123
> ``` zsh
2224
> git checkout qa

local/etc/uceap.d/refresh_content.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function refresh_content() {
44
composer compile-theme
55

66
# download pantheon backups
7-
export TERMINUS_ENV="dev"
7+
export TERMINUS_ENV=${TERMINUS_ENV:-"dev"}
88
FILES_BACKUP=$(mktemp --dry-run files-XXXXXX.tar.gz)
99
DATABASE_BACKUP=$(mktemp --dry-run database-XXXXXX.sql.gz)
1010
terminus backup:get --element=files --to=$FILES_BACKUP
@@ -33,17 +33,20 @@ Refreshes local code, files, and database in devcontainer.
3333
3434
``` bash
3535
uceap refresh-content
36+
TERMINUS_ENV=live uceap refresh-content
3637
```
3738
39+
## Options
40+
41+
This command defaults to using the DEV environment. You can override this by setting the `TERMINUS_ENV` environment variable.
42+
3843
## Description
3944
4045
This command is useful when switching branches.
4146
42-
First it runs composer install, in case the new branch has updated dependencies.
43-
44-
It also compiles the theme, in case there are any changes to the theme between branches.
47+
First it runs composer install, in case the new branch has updated dependencies. It also compiles the theme, in case there are any changes to the theme between branches.
4548
46-
Then it downloads the latest backups from DEV and replaces the local files and database with them.
49+
Then it downloads the latest backups from Pantheon and replaces the local files and database with them.
4750
4851
Finally, it rebuilds the database using the new database backup.
4952
'

0 commit comments

Comments
 (0)