|
1 |
| -# Rancher Deploy |
| 1 | +# sourceboat/rancher-deploy |
| 2 | + |
| 3 | +[](https://hub.docker.com/r/sourceboat/rancher-deploy/builds/) |
| 4 | +[](https://github.com/sourceboat/rancher-deploy/releases) |
| 5 | +[](https://hub.docker.com/r/sourceboat/rancher-deploy/) |
| 6 | +[](https://microbadger.com/images/sourceboat/rancher-deploy) |
| 7 | +[](https://microbadger.com/images/sourceboat/rancher-deploy) |
2 | 8 |
|
3 | 9 | This docker image enables simple deployments to Rancher.
|
4 | 10 | It is a small alpine image with [Rancher CLI](https://rancher.com/docs/rancher/v2.x/en/cli/) `rancher`
|
5 | 11 | and [Kubernetes CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/) `kubectl` installed.
|
| 12 | + |
| 13 | +It also comes with a custom `rancher-redeploy` command (see usage section). |
| 14 | + |
| 15 | +## Usage |
| 16 | + |
| 17 | +### Simple Redeploy via GitLab CI |
| 18 | + |
| 19 | +To use this image via GitLab CI add the following to the `.gitlab-ci.yml`: |
| 20 | + |
| 21 | +```yml |
| 22 | +deploy: |
| 23 | + stage: deploy |
| 24 | + image: sourceboat/rancher-deploy:stable |
| 25 | + variables: |
| 26 | + RANCHER_URL: https://rancher.example.com |
| 27 | + K8S_NAMESPACE: my-namespace-name |
| 28 | + K8S_DEPLOYMENT: my-deployment-name |
| 29 | + script: |
| 30 | + - rancher login $RANCHER_URL --token $RANCHER_TOKEN |
| 31 | + - rancher-redeploy $K8S_NAMESPACE $K8S_DEPLOYMENT |
| 32 | +``` |
| 33 | +
|
| 34 | +Don't forget to provide `$RANCHER_TOKEN` via GitLab CI/CD variable. |
| 35 | + |
| 36 | +This will trigger a redeploy of the given Kubernetes deployment by updating a label |
| 37 | +and pull the newest image if configured correctly. |
| 38 | + |
| 39 | +## Changelog |
| 40 | + |
| 41 | +Check [releases](https://github.com/sourceboat/rancher-deploy/releases) for all notable changes. |
| 42 | + |
| 43 | +## Credits |
| 44 | + |
| 45 | +- [Phil-Bastian Berndt](https://github.com/pehbehbeh) |
| 46 | +- [All Contributors](https://github.com/sourceboat/rancher-deploy/graphs/contributors) |
| 47 | + |
| 48 | +## License |
| 49 | + |
| 50 | +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
0 commit comments