GOV.UK's application deployment code
Ruby Shell
Clone or download
Latest commit 678a170 Jul 17, 2018
Permalink
Failed to load latest commit information.
asset-manager Don't try to notify Errbit of deploys Sep 27, 2017
authenticating-proxy Don't try to notify Errbit of deploys Sep 27, 2017
backdrop-read
backdrop-write Fix a bunch of whitespace issues Aug 2, 2016
bouncer Suport deploying bouncer from gitlab.com Jan 5, 2018
calculators Don't publish content upon deploy Apr 10, 2018
calendars Don't publish content upon deploy Apr 10, 2018
ckan Ensure ckanext-ga-report is installed Jun 26, 2018
collections-publisher Don't try to notify Errbit of deploys Sep 27, 2017
collections
contacts Don't publish content upon deploy Apr 10, 2018
content-audit-tool Add deployment scripts for Content Audit Tool Jan 24, 2018
content-performance-manager Rename procfile worker restart command May 25, 2018
content-publisher
content-store Don't try to notify Errbit of deploys Sep 27, 2017
content-tagger
docker_release Add docker class May 2, 2017
docker_router Add router docker release scripts Aug 14, 2017
email-alert-api Stop deploying email alert apps to backend servers Feb 27, 2018
email-alert-frontend
email-alert-service
errbit Fix a bunch of whitespace issues Aug 2, 2016
feedback
finder-frontend Don't try to notify Errbit of deploys Sep 27, 2017
frontend Don't publish content on deploy of Frontend Mar 20, 2018
government-frontend Don't try to notify Errbit of deploys Sep 27, 2017
govuk-cdn-logs-monitor
govuk-content-schemas Run deploy:notify:docker on non ruby recipies Jan 10, 2018
govuk_crawler_worker
hmrc-manuals-api Stop restarting procfile for HMRC Manuals API Mar 5, 2018
imminence Don't try to notify Errbit of deploys Sep 27, 2017
info-frontend
kibana Add Kibana Jun 20, 2016
lib Add has_repo? method for DockerTagPusher Jan 16, 2018
licencefinder Don't publish content upon deploy Apr 10, 2018
link-checker-api Don't try to notify Errbit of deploys Sep 27, 2017
local-links-manager Don't try to notify Errbit of deploys Sep 27, 2017
manuals-frontend Don't publish content upon deploy Apr 10, 2018
manuals-publisher Don't try to notify Errbit of deploys Sep 27, 2017
mapit Set environment variables when running commands Sep 20, 2017
maslow Don't try to notify Errbit of deploys Sep 27, 2017
organisations-publisher Add Procfile worker restart for organisation publisher Jun 11, 2018
policy-publisher Don't publish content upon deploy Apr 10, 2018
publisher Publisher doesn't need to copy in redis file anymore Oct 18, 2017
publishing-api Don't try to notify Errbit of deploys Sep 27, 2017
recipes Fix release app notification Jun 20, 2018
release Don't try to notify Errbit of deploys Sep 27, 2017
router-api
router Task to git tag a release for an artefact release Jan 19, 2018
rummager Don't publish content upon deploy Apr 10, 2018
search-admin Don't try to notify Errbit of deploys Sep 27, 2017
service-manual-frontend
service-manual-publisher Don't try to notify Errbit of deploys Sep 27, 2017
short-url-manager Don't try to notify Errbit of deploys Sep 27, 2017
sidekiq-monitoring Don't try to notify Errbit of deploys Sep 27, 2017
signon Don't try to notify Errbit of deploys Sep 27, 2017
smartanswers Don't publish content upon deploy Apr 10, 2018
spec
specialist-publisher
stagecraft Ignore command exit codes May 4, 2017
static Don't publish content upon deploy Apr 10, 2018
support-api
support Don't try to notify Errbit of deploys Sep 27, 2017
transition Don't try to notify Errbit of deploys Sep 27, 2017
travel-advice-publisher Don't publish content upon deploy Apr 10, 2018
whitehall Don't publish content upon deploy Apr 10, 2018
.rspec Add RSpec support Apr 5, 2017
.rubocop.yml Add rubocop.yml with exceptions Aug 2, 2016
.ruby-version
Gemfile
Gemfile.lock Bump webmock from 3.2.1 to 3.3.0 Jan 19, 2018
Jenkinsfile Update Jenkinsfile to use external library Mar 2, 2018
LICENCE Add licence file Jul 24, 2017
README.md
Rakefile Add rake task to test Slack message May 15, 2017
jenkins.sh
sync_to_ghe.sh Update remote failover to use new github digital May 12, 2017

README.md

GOV.UK application deployment scripts

Capistrano deployment scripts for applications running on GOV.UK.

Adding a new app

Create a new directory for your app based on one of the other apps e.g.

# Capfile

load 'deploy'

$:.unshift(File.expand_path('../../lib', __FILE__))
load_paths << File.expand_path('../../recipes', __FILE__)

load 'config/deploy'
# config/deploy.rb

set :application, "myapp"
set :capfile_dir, File.expand_path('../', File.dirname(__FILE__))
set :server_class, "myserverclass"
set :repository, "git@github.com/alphagov/myapp.git"

load 'defaults'
load 'ruby'
load 'deploy/assets'

set :copy_exclude, [
  '.git/*'
]

How deployments work

The master jenkins.sh script is run by Jenkins to deploy each app.

Environment variables available to deploy scripts

There are a number of environment variables set in Jenkins that can be used in deploy scripts:

  • DEPLOY_TO - the environment being deployed to
  • DEPLOY_TASK - the deploy task selected in the Jenkins interface ("deploy", "deploy:setup", etc)
  • TAG - the tag/branch entered in the Jenkins interface ("release", "release_1234", "build-1234", etc)
  • ORGANISATION - The vCloud organisation being deployed to
  • CI_DEPLOY_JENKINS_API_KEY - API key used to fetch build artefacts from ci.dev.publishing.service.gov.uk.