https://github.com/sourceboat/rancher-deploy
This docker image enables simple deployments to Rancher.
https://github.com/sourceboat/rancher-deploy
cli deployment docker kubernetes rancher
Last synced: 11 months ago
JSON representation
This docker image enables simple deployments to Rancher.
- Host: GitHub
- URL: https://github.com/sourceboat/rancher-deploy
- Owner: sourceboat
- License: mit
- Created: 2019-02-04T11:19:25.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2022-03-25T08:35:19.000Z (about 4 years ago)
- Last Synced: 2025-04-05T09:51:11.251Z (12 months ago)
- Topics: cli, deployment, docker, kubernetes, rancher
- Language: Dockerfile
- Size: 18.6 KB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# sourceboat/rancher-deploy
[](https://hub.docker.com/r/sourceboat/rancher-deploy/builds/)
[](https://github.com/sourceboat/rancher-deploy/releases)
[](https://hub.docker.com/r/sourceboat/rancher-deploy/)
[](https://microbadger.com/images/sourceboat/rancher-deploy)
[](https://microbadger.com/images/sourceboat/rancher-deploy)
This docker image enables simple deployments to Rancher.
## What's included?
- [Git CLI](https://git-scm.com/) `git`
- [Kubernetes CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/) `kubectl`
- [Rancher CLI](https://rancher.com/docs/rancher/v2.x/en/cli/) `rancher`
- [Sentry CLI](https://docs.sentry.io/cli/) `sentry-cli`
It also comes with a custom `rancher-redeploy` and `rancher-exec` command helper (see usage section).
## Usage
### Simple Redeploy via GitLab CI and `rancher-redeploy` helper
To use this image via GitLab CI add the following to the `.gitlab-ci.yml`:
```yml
deploy:
stage: deploy
image: sourceboat/rancher-deploy:latest
variables:
RANCHER_URL: https://rancher.example.com
K8S_NAMESPACE: my-namespace-name
K8S_DEPLOYMENT: my-deployment-name
script:
- rancher login $RANCHER_URL --token $RANCHER_TOKEN
- rancher-redeploy $K8S_NAMESPACE $K8S_DEPLOYMENT
```
Don't forget to provide `$RANCHER_TOKEN` via GitLab CI/CD variable.
This will trigger a redeploy of the given Kubernetes deployment by updating a label
and pull the newest image if configured correctly.
### Execute Command via `rancher-exec` helper
You can also execute commands in pods of your deployment via `rancher-exec $K8S_NAMESPACE $K8S_DEPLOYMENT 'ls'`.
This will execute the given command in the first pod of your deployment.
Currently this is only tested with single container pods.
## Changelog
Check [releases](https://github.com/sourceboat/rancher-deploy/releases) for all notable changes.
## Credits
- [Phil-Bastian Berndt](https://github.com/pehbehbeh)
- [All Contributors](https://github.com/sourceboat/rancher-deploy/graphs/contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.