Skip to content

Commit

Permalink
📦 NEW - master: 001 iteration POC
Browse files Browse the repository at this point in the history
  • Loading branch information
brandoncamenisch committed Dec 19, 2019
0 parents commit 5d58f50
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
Empty file added README.md
Empty file.
64 changes: 64 additions & 0 deletions build-me-vvv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/sh
echo "Make sure you've cloned the VVV repo and you are in the root of it"
echo ".... git clone https://github.com/Varying-Vagrant-Vagrants/VVV.git"
echo "CONTINUE?"
select yn in "yes" "no"; do case $yn in
yes ) break;;
no ) exit;;
esac
done
echo "Copy config/default-config.yml -> config/config.yml"
echo ".... cp config/default-config.yml config/config.yml"
echo "Add in the sites you need according to the docs here:"
echo "https://varyingvagrantvagrants.org/docs/en-US/adding-a-new-site/"
echo "At the bare minimum you should add this config per site"
echo "==================="
echo "pmc-your-site:"
echo " skip_provisioning: false"
echo " description: 'pmc-your-site'"
echo " repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git"
echo " hosts:"
echo " - pmc-your-site.test"
echo "==================="
echo "Then come back to this script and we'll download the plugins and themes we need for each entry that you added to the config"
echo "CONTINUE?"
select yn in "yes" "no"; do case $yn in
yes ) break;;
no ) exit;;
esac
done

# Clone the repos
git clone https://bitbucket.org/penskemediacorp/pmc-codesniffer.git www/phpcs/CodeSniffer/Standards/pmc-codesniffer
echo "phpcs usage:"
echo "phpcs --standard=/srv/www/phpcs/CodeSniffer/pmc-codesniffer/... some.php"
git clone https://bitbucket.org/penskemediacorp/pmc-core-v2.git www/pmc/pmc-core-v2
git clone https://bitbucket.org/penskemediacorp/pmc-plugins.git www/pmc/pmc-plugins
git clone https://bitbucket.org/penskemediacorp/pmc-vip-go-plugins.git www/pmc/pmc-vip-go-plugins
git clone https://bitbucket.org/penskemediacorp/wordpress-vip-plugins.git www/pmc/wordpress-vip-plugins
git clone https://github.com/automattic/vip-go-mu-plugins-built.git www/pmc/vip-go-mu-plugins-built
git clone https://github.com/automattic/vip-wpcom-mu-plugins.git www/pmc/vip-wpcom-mu-plugins
git -C www/pmc/vip-wpcom-mu-plugins submodule init
git -C www/pmc/vip-wpcom-mu-plugins submodule update

# Start the machine
vagrant up --provision
vagrant ssh -- -t 'if ! grep PMC_PHPUNIT_BOOTSTRAP ~/.bashrc; then echo export PMC_PHPUNIT_BOOTSTRAP="/srv/www/vip/public_html/wp-content/themes/vip/pmc-plugins/pmc-unit-test/bootstrap.php" >> ~/.bashrc; fi'

for i in $(ls -d www/pmc-* | xargs -n1 basename)
do
git clone https://bitbucket.org/penskemediacorp/$i.git www/$i/public_html/wp-content/themes/$i
vagrant ssh -- -t "mkdir -p /srv/www/$i/public_html/wp-content/mu-plugins && ln -svf /srv/www/pmc/pmc-plugins /srv/www/$i/public_html/wp-content/plugins && ln -svf /srv/www/pmc/pmc-vip-go-plugins/* /srv/www/$i/public_html/wp-content/plugins"
echo "Is this site $i go or wpcom"
select yn in "go" "wpcom"; do case $yn in
go ) vagrant ssh -- -t "ln -svf /srv/www/pmc/vip-go-mu-plugins-built/* /srv/www/$i/public_html/wp-content/mu-plugins" && break;;
wpcom ) vagrant ssh -- -t "ln -svf /srv/www/pmc/vip-wpcom-mu-plugins/* /srv/www/$i/public_html/wp-content/mu-plugins" && break;;
esac
done
echo "Does $i use pmc-core-v2?"
select yn in "yes" "no"; do case $yn in
yes ) vagrant ssh -- -t "mkdir -p /srv/www/$i/public_html/wp-content/themes/vip && ln -svf /srv/www/pmc/pmc-core-v2 /srv/www/$i/public_html/wp-content/themes/vip" && break;;
no ) break;;
esac
done
done;

0 comments on commit 5d58f50

Please sign in to comment.