Skip to content

Instantly share code, notes, and snippets.

@crittermike
Created August 6, 2018 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crittermike/0d046b54a240b19fed910bd3e9e1cec9 to your computer and use it in GitHub Desktop.
Save crittermike/0d046b54a240b19fed910bd3e9e1cec9 to your computer and use it in GitHub Desktop.
#!/bin/bash
## Push the local site to the Pantheon repo
yellow='\033[1;33m'
NC='\033[0m'
cd "$PROJECT_ROOT"
echo
echo -e "${yellow}Cloning Pantheon repo...${NC}"
git clone PANTHEON_REPO_URL pantheon-codebase
echo
echo -e "${yellow}Copying web directory to Pantheon repo...${NC}"
rm -rf pantheon-codebase/*
cp -r web/* pantheon-codebase
cd pantheon-codebase
git checkout -- sites/default/settings.php
git add *
git status
read -p "Does this look correct? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo
echo -e "${yellow}Pushing to Pantheon...${NC}"
git commit -m "Updates from GitHub repo"
git push
fi
echo
echo -e "${yellow}Cleaning up...${NC}"
cd "$PROJECT_ROOT"
rm -rf pantheon-codebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment