Retire an application
To remove an application from our infrastructure take the following steps:
- Put a database backup in the archive:
Grab a copy of the latest production backup of the database and put a copy in
/data/backups/archived directory on the
This will then be included in the sync to the offsite backup machines
- Configure puppet to remove the app from all servers:
Change the app resource, and any database resources to
ensure => absent,
remove any host and load-balancer entries, but leave the hieradata entries.
See this pull request for an example.
Remove any smokey tests specific to the application.
Mark the application as archived in the Release app:
Edit the application in the release app (you’ll need the
permission to do this), and check the
archived checkbox. This will
hide it from the UI.
- Remove entry from the deploy Jenkinses:
This is managed through GOV.UK Puppet in the
- Move the repository to the attic:
Go into the repository settings in Github, and change the owner to gds-attic. Once moved, delete any webooks and services that exist for it.
- Delete the application from Errbit:
On all 3 errbit instances, delete the application (you’ll need the
permission to do this). The delete button can be found in the application
Handling timeouts from the UI:
If the app has received lots of errors, the request to delete it can timeout. If this happens, it will need to be deleted manually from the rails console as follows:
- ssh to
start a rails console
Find and destroy the application:
a = App.where(:name => "Foo API").first a.destroy # This could take a long time to return
- Mark the application as “retired” in signon, if it used it:
Click on the Applications tab. Find the application that is being retired and click the “edit” button. Tick the box that says “This application is being retired”, then save your changes.
- Remove from the development repo
Leave a comment in the
Procfile indicating that the port used to be
used by this app (eg https://github.gds/gds/development/pull/149)
- Check the data replication scripts for anything specific to this application:
Some applications have special case details in https://github.gds/gds/env-sync-and-backup/. Any relating to the application should be removed.
- Request any public DNS entries be removed:
If the app had an admin UI, it will have had public DNS entries in the
publishing.service.gov.uk domain. Request that the infrastructure
team remove these, or, if appropriate, transition them.
- Document the retirement in the developer docs:
Mark the application as
retired in govuk-developer-docs.
- Remove any references in other applications:
Do a code search on GitHub to find any references to the application and update or remove them.
Once puppet has removed the app from production, cleanup the remaining bits:
- Remove all remaining puppet code relating to the app:
For example: https://github.com/alphagov/govuk-puppet/pull/5507
- Remove any hieradata credential entries for the app:
For example: https://github.gds/gds/deployment/pull/408
- Drop the database for the app if puppet hasn’t done it (eg for Mongo databases).