Get deploy token¶
Before performing any deployment task, run the Setup tasks below. Once done, run the Cleanup tasks below. If you haven’t already, please follow the Get started guide.
1. Update deploy repositories¶
salt/maintenance repositories are on the default branch and are up-to-date. You can run this convenience script to run the appropriate
Check the output in case there are any issues switching to the default branch or any conflicts pulling from GitHub.
2. Check if Kingfisher is busy¶
Skip this step unless you’re working on Kingfisher.
Access Scrapyd’s web interface, click Jobs and look under Running. If any spiders are running, don’t deploy without the consent of helpdesk analysts.
Connect to the Kingfisher server as the
curl --silent --connect-timeout 1 collect.kingfisher.open-contracting.org:8255 || true ssh firstname.lastname@example.org
Check if any long-running tasks are running, by attaching to each session in
tmuxto see which commands are running. If any commands would be interrupted by the deployment, don’t deploy without the consent of the helpdesk analysts, who should be identified by the session names.
To list all sessions:
for i in root ocdskfp; do echo $i; su $i -c "tmux ls"; done
postgresservice would be restarted by the deployment (for example, due to a configuration change or a package upgrade), check if any long-running queries are running. If there are queries with a
timegreater than an hour, don’t deploy without the consent of the helpdesk analysts, who should be identified by the
client_addror comment at the start of
If you must deploy while spiders are running, see how to deploy Kingfisher Process without losing Scrapy requests.
3. Get deploy token¶
Only one person should be making changes to a server at once. To implement this rule, the Deploy token document indicates who “holds the deploy token.” Whoever holds the deploy token is the only person who can make changes to any server, until the deploy token is released. If the document has “Held by: <NAME>”, that person holds the token. If it has “Held by: Nobody”, then the token is released. To hold the token:
- Go to the Deploy token document
- If “Held by” is followed by a person’s name, wait until the deploy token is released
- Replace “Nobody” with your name