{"id":13450402,"url":"https://github.com/kiwicom/crane","last_synced_at":"2025-03-23T16:31:23.527Z","repository":{"id":48331927,"uuid":"86802251","full_name":"kiwicom/crane","owner":"kiwicom","description":"⬆ A GitLab CI ready image to upgrade services in Rancher","archived":true,"fork":false,"pushed_at":"2023-04-04T14:49:24.000Z","size":324,"stargazers_count":96,"open_issues_count":27,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-19T22:36:42.927Z","etag":null,"topics":["docker","docker-image","gitlab","gitlab-ci","rancher","rancher-api","rancher-upgrades"],"latest_commit_sha":null,"homepage":"https://code.kiwi.com/announcing-crane-e8ce911b187b","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiwicom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-31T09:28:10.000Z","updated_at":"2024-01-03T14:14:43.000Z","dependencies_parsed_at":"2024-07-31T07:12:20.023Z","dependency_job_id":"ca0fef1f-a17f-40ad-aa75-b412c0a37b8c","html_url":"https://github.com/kiwicom/crane","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwicom%2Fcrane","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwicom%2Fcrane/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwicom%2Fcrane/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwicom%2Fcrane/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiwicom","download_url":"https://codeload.github.com/kiwicom/crane/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245130754,"owners_count":20565705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","gitlab","gitlab-ci","rancher","rancher-api","rancher-upgrades"],"created_at":"2024-07-31T07:00:34.299Z","updated_at":"2025-03-23T16:31:23.154Z","avatar_url":"https://github.com/kiwicom.png","language":"Python","funding_links":[],"categories":["Python","Rancher 1.0"],"sub_categories":["Community projects 1.0"],"readme":"# crane\n\n![crane logo - an origami crane](logo.png)\n\nA GitLab CI ready image to upgrade services in Rancher.\nSee the [whole story on our blog at code.kiwi.com](https://code.kiwi.com/announcing-crane-e8ce911b187b)!\n\n[![Python: 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://python.org)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/ambv/black)\n[![Gitlab pipeline status (branch)](https://img.shields.io/gitlab/pipeline/kiwicom/crane/master.svg)](https://gitlab.com/kiwicom/crane/pipelines)\n\n## Usage\n\n1. Deploy your application on Rancher manually,\n   with an image tagged with a git reference\n   (our recommendation is to use the commit SHA, but you can also use git tags.)\n2. Get a Rancher Environment API key\n   and add the API keypair as secret variables in the project,\n   named `RANCHER_ACCESS_KEY` and `RANCHER_SECRET_KEY`.\n3. Also add `RANCHER_URL` and `RANCHER_ENV_ID`,\n   preferably in secret variables, or in `.gitlab-ci.yml`.\n   (In the example URL `https://rancher.example.com/env/1a81/apps/stacks/1e551/services/1s1456/containers`\n   the environment ID is `1a81`. This ID always starts with `1a`.)\n4. Add something like this to your `.gitlab-ci.yml`:\n\n   ```yaml\n   stages:\n     # [...]\n     - deploy\n\n   deploy-production:\n     stage: deploy\n     image: kiwicom/crane:3.2.1\n     script:\n       - crane --stack my-app --service api --service worker\n     environment:\n       name: production\n       url: https://my-app.example.com/\n     when: manual\n   ```\n\n## Settings\n\n| CLI flag                | Environment variable        | Required | Default |\n| ----------------------- | --------------------------- | -------- | ------- |\n| `--url`                 | `RANCHER_URL`               | Yes      |         |\n| `--access-key`          | `RANCHER_ACCESS_KEY`        | Yes      |         |\n| `--secret-key`          | `RANCHER_SECRET_KEY`        | Yes      |         |\n| `--env`                 | `RANCHER_ENV_ID`            | Yes      |         |\n| `--stack`               | `RANCHER_STACK_NAME`        | Yes      |         |\n| `--new-commit`          | `CRANE_NEW_COMMIT`          | No       | HEAD    |\n| `--new-image`           | `CRANE_NEW_IMAGE`           | No       | None    |\n| `--service`             | `RANCHER_SERVICE_NAME`      | No       | app     |\n| `--sidekick`            | `RANCHER_SIDEKICK_NAME`     | No       | None    |\n| `--batch-size`          | `CRANE_BATCH_SIZE`          | No       | 1       |\n| `--batch-interval`      | `CRANE_BATCH_INTERVAL`      | No       | 2       |\n| `--start-first`         | `CRANE_START_FIRST`         | No       | False   |\n| `--sleep-after-upgrade` | `CRANE_SLEEP_AFTER_UPGRADE` | No       | 0       |\n| `--manual-finish`       | `CRANE_MANUAL_FINISH`       | No       | False   |\n\n## Integrations \u0026 Extensions\n\n### Slack\n\nWhen `--slack-token` is set,\ncrane can post an announcement to `--slack-channel`\nwith details about the ongoing deployment.\nYou can use `--slack-link` to add useful URLs to this announcements\nsuch as Datadog dashboards, Sentry issues, or the project repository.\nYou can set `--slack-channel` multiple times;\nall channels will have the same annnouncement posted to them.\nIf you're setting the channel names via the environment variable,\nseparate them with a space.\n\n| CLI flag          | Environment variable  | Details                       |\n| ----------------- | --------------------- | ----------------------------- |\n| `--slack-token`   | `CRANE_SLACK_TOKEN`   | Slack API token               |\n| `--slack-channel` | `CRANE_SLACK_CHANNEL` | Slack channels to announce in |\n| `--slack-link`    | `CRANE_SLACK_LINK`    | links to mention in Slack     |\n\n### Sentry\n\nWith `--sentry-webhook`, crane can post release details to Sentry.\n[Release tracking](https://docs.sentry.io/learn/releases/#what-is-a-release) is useful\nto provide additional context to errors tracked in Sentry.\n\n| CLI flag           | Environment variable   | Details                    |\n| ------------------ | ---------------------- | -------------------------- |\n| `--sentry-webhook` | `CRANE_SENTRY_WEBHOOK` | Sentry release webhook URL |\n\n### Datadog\n\nIf you set an API key with `--datadog-key`,\nCrane will post successful and failed releases to your Datadog event feed.\nThese events can then be marked on charts and displayed on dashboards.\n\n| CLI flag        | Environment variable | Details                      |\n| --------------- | -------------------- | ---------------------------- |\n| `--datadog-key` | `CRANE_DATADOG_KEY`  | URLs to post release info to |\n\n### Generic webhooks\n\nWith the `--webhook-url` option,\nyou can specify URLs that crane will send release info to,\nin its own format.\nOne use for this is for analytics;\nif somebody sets up a listener for these events,\nthey'll have the data needed to identify correlations\nbetween releases and changes in user behavior or sales numbers.\n\n| CLI flag          | Environment variable  | Details                      |\n| ----------------- | --------------------- | ---------------------------- |\n| `--webhook-url`   | `CRANE_WEBHOOK_URL`   | URLs to post release info to |\n| `--webhook-token` | `CRANE_WEBHOOK_TOKEN` | Auth token for webhooks      |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwicom%2Fcrane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiwicom%2Fcrane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwicom%2Fcrane/lists"}