Skip to content

Utility Scripts To Upgrade Server And Octopus Instance

jamiet76 edited this page Mar 31, 2011 · 1 revision

I have created a couple of utility scripts to upgrade the server and Octopus instances using the latest BARRACUDA / OCTOPUS scripts.
Upgrade server / master aegir environment.

Currently to upgrade the server one has to follow the directions in [the upgrade text file](https://github.com/omega8cc/nginx-for-drupal/blob/master/docs/UPGRADE.txt). As this is not necessarily a frequent task I found myself continually referring to this text file to copy and paste the commands. These commands are relatively simple so I thought I would create a bash script to automate this so all I had to do was run the bash script. Code as follows:

#!/bin/bash
### Small script tobackup and  fetch latest BARRACUDA script replace email address and run script
# Filename upgrade-server.sh
# Backup old script in case of issues
mv BARRACUDA.sh.txt BARRACUDA.sh.txt-old
# Fetch latest BARRACUDA script from aegir site
cd; wget http://code.aegir.cc/aegir/barracuda-octopus/blobs/raw/master/BARRACUDA.sh.txt
# Replace notify@omega8.cc with your admin email address (change admin@mydomain.com to your real email address)
cd; sed -i 's/notify@omega8.cc/admin@mydomain.com/' BARRACUDA.sh.txt
# Run BARRACUDA script
cd; bash BARRACUDA.sh.txt

Save the above script in a file called “upgrade-server.sh” and everytime you want to upgrade the server issue the command

bash upgrade-server.sh

and then follow the usual prompts for the BARRACUDA script when it is run.

Upgrade Octopus aegir environment.

Along similar lines the following script performs the same task for an OCTOPUS instance:

#!/bin/bash
### Small script tobackup and  fetch latest OCTOPUS script replace email address and run script
# Filename upgrade-octopus.sh
# Backup old script in case of issues
mv OCTOPUS.sh.txt OCTOPUS.sh.txt-old
# Fetch latest BARRACUDA script from aegir site
cd; wget http://code.aegir.cc/aegir/barracuda-octopus/blobs/raw/master/OCTOPUS.sh.txt
# Replace o1 with your octopus instance id (xyz)
cd; sed -i 's/o1/xyz/' OCTOPUS.sh.txt
# Replace noc@omega8.cc with your admin email address for MY EMAIL ADDRESS
cd; sed -i 's/noc@omega8.cc/admin@mydomain.com/' OCTOPUS.sh.txt
# Replace notify@omega8.cc with your client email address for CLIENT EMAIL ADDRESS
cd; sed -i 's/notify@omega8.cc/admin@mydomain.com/' OCTOPUS.sh.txt
# Run OCTOPUS script
cd; bash OCTOPUS.sh.txt

Obviously you use these scripts at your own risk and YMMV – so be warned.