Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
yellow='\033[1;33m'
NC='\033[0m'
cd "$PROJECT_ROOT"
echo
echo -e "${yellow}Cloning Pantheon repo...${NC}"
git clone ssh://codeserver.dev.f5ee6474-0663-441f-8ef0-9f5f54e427d4@codeserver.dev.f5ee6474-0663-441f-8ef0-9f5f54e427d4.drush.in:2222/~/repository.git pantheon-codebase
echo
echo -e "${yellow}Copying web directory to Pantheon repo...${NC}"
rm -rf pantheon-codebase/*
cp -r web/* pantheon-codebase
git clone git@github.com:pantheon-systems/drops-7.git
cp -r drops-7/includes pantheon-codebase/
cp -r drops-7/modules pantheon-codebase/
cp -r drops-7/profiles pantheon-codebase/
cp -r drops-7/themes pantheon-codebase/
cp -r drops-7/pantheon.upstream.yml pantheon-codebase/pantheon.upstream.yml
cp drops-7/LICENSE.txt pantheon-codebase/LICENSE.txt
cp -r drops-7/modules/pantheon pantheon-codebase/modules
cp -r drops-7/misc/healthchecks pantheon-codebase/misc
cp -r drops-7/profiles/pantheon pantheon-codebase/profiles
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