Created
November 16, 2017 07:44
-
-
Save kopepasah/9d952649b7ee3a9444cea850fc20127f to your computer and use it in GitHub Desktop.
Updates WordPress Core on the Pantheon hosting platform using Terminus.
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
#!/bin/bash | |
echo "Preparing update..." | |
terminus login --email=your@email.com -q | |
terminus connection:set site.dev sftp -q | |
echo "Validating update..." | |
if [[ $(terminus wp site.dev -- core check-update) == *"WordPress is at the latest version"* ]] 2>/dev/null; then | |
terminus wp site.dev -- core version --extra 2>/dev/null | |
echo "No WordPress Core update to apply." | |
echo "Exiting." | |
exit | |
else | |
terminus wp site.dev -- core update 2>/dev/null | |
fi | |
VERSION=$(terminus wp site.dev --no-ansi -- core version 2>/dev/null) | |
echo "Committing update..." | |
terminus env:diffstat site.dev -q | |
terminus env:commit site.dev --message="Update WordPress Core to $VERSION" 2>/dev/null | |
echo "Deploying to test..." | |
terminus deploy site.test --cc --note="Deploy WordPress Core $VERSION Update" 2>/dev/null | |
echo "Cleaning up..." | |
terminus connection:set site.dev git -q | |
echo "WordPress Updated to $VERSION on dev and test." | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment