diff --git a/wordpressorg.test/provision/vvv-init.sh b/wordpressorg.test/provision/vvv-init.sh index 05c3dd6f2..31801c154 100644 --- a/wordpressorg.test/provision/vvv-init.sh +++ b/wordpressorg.test/provision/vvv-init.sh @@ -19,6 +19,30 @@ WP_LOCALES=( ja es_ES ) wme_svn_git_migration $SITE_DIR +function wme_wporg_setup_cavalcade() { + # Cavalcade + printf "Installing Cavalcade..." + wme_noroot git clone https://github.com/humanmade/Cavalcade.git "${SITE_DIR}/wp-content/mu-plugins/cavalcade" + wme_noroot cp -f "${PROVISION_DIR}/cavalcade.php" "${SITE_DIR}/wp-content/mu-plugins/" + + if [[ -d "/etc/cavalcade" ]]; then + pushd "/etc/cavalcade" + git pull + popd + else + mkdir -p "/etc/cavalcade" + git clone https://github.com/humanmade/Cavalcade-Runner.git "/etc/cavalcade" + fi + + mkdir -p "/etc/init/" + cp -f "${PROVISION_DIR}/cavalcade-wordpressorg.conf" "/etc/init/cavalcade-wordpressorg.conf" + if service cavalcade-wordpressorg restart; then + printf "cavalcade service restarted" + else + printf "cavalcade service did not restart" + fi +} + if [ ! -L $SITE_DIR ]; then printf "\n#\n# Provisioning $SITE_DOMAIN\n#\n" @@ -82,20 +106,7 @@ if [ ! -L $SITE_DIR ]; then wme_download_pomo "${gplocale}" "meta/o2" "$SITE_DIR/wp-content/languages/themes/o2-${locale}" done - # Cavalcade - printf "Installing Cavalcade..." - git clone https://github.com/humanmade/Cavalcade.git $SITE_DIR/wp-content/mu-plugins/cavalcade - cp -f $PROVISION_DIR/cavalcade.php $SITE_DIR/wp-content/mu-plugins/ - - if [[ ! -d "/etc/cavalcade" ]]; then - git clone https://github.com/humanmade/Cavalcade-Runner.git /etc/cavalcade - else - git -C /etc/cavalcade pull - fi - - mkdir -p "/etc/init/" - cp -f "$PROVISION_DIR/cavalcade-wordpressorg.conf" "/etc/init/cavalcade-wordpressorg.conf" - service cavalcade-wordpressorg restart + wme_wporg_setup_cavalcade # Ignore external dependencies and Meta Environment tweaks IGNORED_FILES=( @@ -151,13 +162,7 @@ else # translate.wordpressorg.test git -C $SITE_DIR/wp-content/plugins/glotpress pull - # Cavalcade - git -C $SITE_DIR/wp-content/mu-plugins/cavalcade pull - git -C /etc/cavalcade pull - cp -f "$PROVISION_DIR/cavalcade.php" "$SITE_DIR/wp-content/mu-plugins/" - mkdir -p "/etc/init" - cp -f "$PROVISION_DIR/cavalcade-wordpressorg.conf" "/etc/init/cavalcade-wordpressorg.conf" - service cavalcade-wordpressorg restart + wme_wporg_setup_cavalcade fi # Pull global header/footer