Boost Core Auto Deploy Process

From Metro Studios Knowledgebase

Jump to: navigation, search

In order to assure that all new core updates are pushed/added to every site, we've set up an auto deploy process that will step through all sites on all of our servers (with the exception of slice4) and traverse into each sites boost core repository and pull from the master (

Once a commit is pushed to the master repo, a post update hook ( is fired off which runs the following commands:

cd /home/coreupdate/;
sudo -u coreupdate  bash &> core_update.log;
sudo -u coreupdate  bash;
sudo -u coreupdate  bash &> b2_core_update.log;
sudo -u coreupdate  bash;

We'll break each piece down to clearly define its role in the whole process.

  1. cd /home/coreupdate/;

    This command changes the directory to the coreupdate user (the user that has permissions to run all the scripts on all the individual servers).

  2. sudo -u coreupdate  bash &> core_update.log;

    This command runs the script /home/coreupdate/ which steps through each server and runs the [SERVER]/home/coreupdate/ as the user coreupdate and logs the output from the script into the file /home/coreupdate/core_update.log.

  3. sudo -u coreupdate  bash;

    This command runs the script /home/coreupdate/ as the user coreupdate which mails the contents of the core_update.log file to [email protected]

[edit] Process Summary

Once the commit has been pushed to the master repo, the core_update script steps through each of our servers and runs the update_site_cores script on that server. The update_site_cores script will step through each virtual host in the /var/www/vhosts/ directory and check to see if the _boost directory exists. If the site has boost installed, the script will traverse into the core and run a git pull from the origin which will update that repo, before moving on to the next virtual host. Once all servers have been updated, the script will then load the log file that was generated and will email that out to [email protected] (the email account set up to send to all of our developers).

[edit] Referenced Scripts

    web_servers=(web3 web4 web5 web6 dev1)
    # Loop through all servers and run the shell script
    for server in ${web_servers[@]}; do
         echo $server;
         ssh -p 11200 -t -t coreupdate@${server} '~/';
    2>&1 | tee logfile.log
  2. [SERVER]/home/coreupdate/
    DIRS=$(find "/var/www/vhosts/" -maxdepth 1 -type d)
    for dir in $DIRS
            if [ -d "${dir}/httpdocs/_boost" ]; then
                    echo "${dir} is being updated."
                    cd ${dir}/httpdocs/_boost/core/;
                    git pull origin master;
                    sudo chown -R coreupdate:git-users ${dir}/httpdocs/_boost/core/;
                    sudo chown -h coreupdate:git-users ${dir}/httpdocs/_admin;
Personal tools
Wiki Navigation