rancher-cli in Docker. Small image (~ 6MB) for rancher-cli based on Alpine.
462
Create a new api key in your rancher under "API", "Keys".
e.g https://rancher.example.com/v2-beta for account api keys.
e.g https://rancher.example.com/v2-beta/projects/1a1337 for environment api keys.
Environment name or id. Maybe optional if you use an environment api key.
Add the variables RANCHER_URL, RANCHER_ACCESS_KEY, RANCHER_SECRET_KEY and RANCHER_ENVIRONMENT to the secret variables under CI / CD in the group in Gitlab that correspond to your environment in Rancher.
variables:
RANCHER_STACK_NAME: $CI_PROJECT_NAME-$CI_ENVIRONMENT_NAME
staging:
image: foobox/rancher-cli:latest
stage: deploy
environment: staging
script:
- rancher up --upgrade --pull --stack $RANCHER_STACK_NAME --file docker-compose.yml --rancher-file rancher-compose.yml
Content type
Image
Digest
Size
5.6 MB
Last updated
over 8 years ago
docker pull foobox/rancher-cli