Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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