-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tabs for IC vs Non-IC when resetting dev to live
- Loading branch information
1 parent
05223db
commit ed6d790
Showing
3 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
#Authenticate Terminus | ||
terminus auth:login | ||
|
||
#Provide the target site name (e.g. your-awesome-site) | ||
echo 'Provide the site name (e.g. your-awesome-site), then press [ENTER] to reset the Dev environment to Live:'; | ||
read SITE; | ||
|
||
#Set the Dev environment's connection mode to Git | ||
echo "Making sure the environment's connection mode is set to Git..."; | ||
terminus connection:set $SITE.dev git | ||
|
||
#Identify the second most recent commit deployed to Live and overwrite history on Dev's codebase to reflect Live | ||
echo "Rewriting history on the Dev environment's codebase..."; | ||
git reset --hard `terminus env:code-log $SITE.live --format=string | grep -m2 'live' | tail -n 1 | cut -f 4` | ||
|
||
#Force push to Pantheon to rewrite history on Dev and reset codebase to Live | ||
git push origin master -f | ||
|
||
#Clone database and files from Live into Dev | ||
echo "Importing database and files from Live into Dev..."; | ||
terminus env:clone-content $SITE.live dev | ||
|
||
#Open the Dev environment on the Site Dashboard | ||
terminus dashboard:view $SITE.dev |