Skip to content
⬆ A GitLab CI ready image to upgrade services in Rancher
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
crane slack: Fix empty messages not being generated Apr 3, 2019
tests test_hooks_slack: Add expectation of KeyError on getting messages Apr 3, 2019
.coafile Revise .coafile and reformat code Oct 6, 2017
.dockerignore Initial commit Jan 12, 2017
.gitlab-ci.yml gitlab-ci: Use official $CI_BUILD_REF_SLUG Apr 2, 2019
.pre-commit-config.yaml code-format: Use ambv/black Aug 8, 2018
.yamllint Initial commit Jan 12, 2017 Release 3.3.0 Apr 3, 2019
Dockerfile Dockerfile: Stop specifying alpine version Aug 27, 2018
LICENSE Add license Oct 17, 2017 README: Document multiple Slack channels support Apr 3, 2019
logo.png Revert "logo.png: Fix quality" Oct 13, 2017 slack: Retry if loading workspace data fails Apr 3, 2019
requirements.txt Update requirements Apr 3, 2019 Release 3.3.0 Apr 3, 2019 test-requirements: Add missing requests-mock package Nov 21, 2018
test-requirements.txt Update requirements Apr 3, 2019


crane logo - an origami crane

A GitLab CI ready image to upgrade services in Rancher. See the whole story on our blog at!

Python: 3.7 Code style: black Discord Gitlab pipeline status (branch)


  1. Deploy your application on Rancher manually, with an image tagged with a git reference (our recommendation is to use the commit SHA, but you can also use git tags.)

  2. Get a Rancher Environment API key and add the API keypair as secret variables in the project, named RANCHER_ACCESS_KEY and RANCHER_SECRET_KEY.

  3. Also add RANCHER_URL and RANCHER_ENV_ID, preferably in secret variables, or in .gitlab-ci.yml. (In the example URL the environment ID is 1a81. This ID always starts with 1a.)

  4. Add something like this to your .gitlab-ci.yml:

      # [...]
      - deploy
      stage: deploy
      image: kiwicom/crane:3.2.1
        - crane --stack my-app --service api --service worker
        name: production
      when: manual


CLI flag Environment variable Required Default
--access-key RANCHER_ACCESS_KEY Yes
--secret-key RANCHER_SECRET_KEY Yes
--new-image CRANE_NEW_IMAGE No None
--batch-size CRANE_BATCH_SIZE No 1
--batch-interval CRANE_BATCH_INTERVAL No 2
--start-first CRANE_START_FIRST No False
--sleep-after-upgrade CRANE_SLEEP_AFTER_UPGRADE No 0
--manual-finish CRANE_MANUAL_FINISH No False

Integrations & Extensions


When --slack-token is set, crane can post an announcement to --slack-channel with details about the ongoing deployment. You can use --slack-link to add useful URLs to this announcements such as Datadog dashboards, Sentry issues, or the project repository. You can set --slack-channel multiple times; all channels will have the same annnouncement posted to them. If you're setting the channel names via the environment variable, separate them with a space.

CLI flag Environment variable Details
--slack-token CRANE_SLACK_TOKEN Slack API token
--slack-channel CRANE_SLACK_CHANNEL Slack channels to announce in
--slack-link CRANE_SLACK_LINK links to mention in Slack


With --sentry-webhook, crane can post release details to Sentry. Release tracking is useful to provide additional context to errors tracked in Sentry.

CLI flag Environment variable Details
--sentry-webhook CRANE_SENTRY_WEBHOOK Sentry release webhook URL


If you set an API key with --datadog-key, Crane will post successful and failed releases to your Datadog event feed. These events can then be marked on charts and displayed on dashboards.

CLI flag Environment variable Details
--datadog-key CRANE_DATADOG_KEY URLs to post release info to

Generic webhooks

With the --webhook-url option, you can specify URLs that crane will send release info to, in its own format. One use for this is for analytics; if somebody sets up a listener for these events, they'll have the data needed to identify correlations between releases and changes in user behavior or sales numbers.

CLI flag Environment variable Details
--webhook-url CRANE_WEBHOOK_URL URLs to post release info to
--webhook-token CRANE_WEBHOOK_TOKEN Auth token for webhooks
You can’t perform that action at this time.