-
Notifications
You must be signed in to change notification settings - Fork 96
Release and deploy procedure
This document attempts to outline the steps that are needed to cut a release and then get it deployed on the production environment. It is accurate as of the 21st of January 2014.
Packaging the Hilary
and 3akai-ux
codebases should happen on a similar machine as where they will be hosted from.
We have a unit0
machine available for this specific case.
On unit0 do:
- cd /opt
- rm -rf oae
- puppet agent -t
- stop hilary service
- run the tests in
/opt/oae
withgrunt test
(ensure that there are no failures. If they are you should be able to explain thoroughly why that is the case) - clear out the
/opt/oae
directory (things like log files, target, previous releases, ..) - run the release script (
bin/release -spv 4.0.0
)- This will run npm-shrinkwrap, package everything up, create a tarball, hash the tarball and put the results in a
dist
directory - Read the output of the script to know what it does next
- It will add a commit that bumps the version in package.json and add a commit that removes the npm shrinkwrap, ensure that these are present and push them to github
- The tar.gz file will contain the node version that it has been compiled with. This is thus the version of node you should go with on production
- This will run npm-shrinkwrap, package everything up, create a tarball, hash the tarball and put the results in a
You can now update your puppet scripts with your new package information.
The hash (see the generated txt file) should be set into puppet-hilary/environments/production/hiera/common.json
and the package name can be changed as well.
You should upload the hash file and tarball into the oae-release
bucket on amazon S3.
This can be done with:
s3cmd put dist/hilary-4.0.0-....tar.gz s3://oae-release/oae-4.0.0./hilary-4.0.0...tar.gz
s3cmd put dist/hilary-4.0.0-....txt s3://oae-release/oae-4.0.0./hilary-4.0.0-...txt
The puppet scripts will pull it down from S3 and verify the source is intact by doing a checksum and verifying it with the hash.
The release process for 3akai-ux is very similar, on unit0:
- ensure there is no build file, run npm install
- run bin/release -spv 4.0.0
- This will package, minimize and optimize the UI assets
- This will produce a tar.gz for the UI which can be dealt with in the same way as Hilary
- You will have to manually create the 4.0.0 tag and push it to Github
Update your puppetmaster's puppet-hilary to the latest version
It's usually a good idea to tail the logs on the syslog
node (in another terminal) and tail the logs to see what is going on
cd /var/log/rsyslog
tail -f pp0-....local0.log | ./filter-bunyan
SSH into the bastion node as the deploy user
You'll see the oae-fabric repository in ~, cd into it
Run fab list
to see what it does
Start with the preview processor nodes: fab -H pp0 upgrade
When you get the error /tmp/hilary_backup
exists from a previous upgrade, purge it first` you will need to run:
fab -H pp0 hilary.purge_clean_backup
fab -H pp0 ui.purge_clean_backup
Re-run with
fab -H pp0 upgrade:force_hilary_clean,force_ui_clea
Check that it came back up OK and the logs don't indicate anything to troublesome. If so, do it for pp1 and pp2 fab -H pp1,pp2 upgrade