Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nhumrich/deploy-to-rancher
A deployment script for deploying containers to Rancher (rancher.com)
https://github.com/nhumrich/deploy-to-rancher
deployment devops rancher wercker
Last synced: about 1 month ago
JSON representation
A deployment script for deploying containers to Rancher (rancher.com)
- Host: GitHub
- URL: https://github.com/nhumrich/deploy-to-rancher
- Owner: nhumrich
- License: apache-2.0
- Created: 2017-02-01T18:14:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-31T19:05:35.000Z (over 7 years ago)
- Last Synced: 2024-09-03T00:05:06.397Z (5 months ago)
- Topics: deployment, devops, rancher, wercker
- Language: Python
- Size: 8.79 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deploy-to-rancher
A deployment script for deploying containers to Rancher (rancher.com)This repo contains a deployment script to deploy a container to rancher.
The deployment will automatically deploy a service to rancher, doing an in-place rolling upgrade.
The upgrade will upgrade one container at a time, with 20 seconds inbetween each container.The script will also check the status of the container while deploying, and will automatically rollback if the
container every goes unhealthy during deployment.
If a rollback occurs, the container logs will be displayed.This script requires python 3.5. You can either run the script directly, or inside the provided docker container.
##
using:In order to use this script, you need the following environment variables set:
```
RANCHER_ACCESS_KEY
RANCHER_SECRET_KEY
RANCHER_URL # must include path to the "environment" (project), you get this on the api page for the env
RANCHER_STACK_NAME # stack name of the service you want to deploy
```Then run the script like this:
```bash
deploy-to-rancher.py --service-name foobar --docker-image 'nhumrich/foobar' --docker-tag sometag
```Alternate environment variables:
```
DOCKER_IMAGE_NAME # the base name of the docker image you want to deploy, can be used instead of --docker-image
```## using on wercker
If you are using this on wercker, the service name is assumed from the environment variable `WERCKER_APPLICATION_NAME` which wercker provides. So if your service is the same as your repository name, you get that for free.
I also recommend pushing your docker container with the tag as the git SHA `$WERCKER_GIT_COMMIT`, then you can use `--docker-tag "$WERCKER_GIT_COMMIT"`.## using the docker container
You can use the docker container to run this script in a prebuild environment. use the `nhumrich/deploy-to-rancher` container, and run the script from the `/scripts` directory. `/scripts/deploy-to-rancher.py ...`