I needed to use the Travis Client command line utitlity to generate secure (encrypted) credentials for one of my projects. I did not want to install the client on my system along with the Ruby gem package manager so I decided to create a small docker container instead.
Refer to the documentation on how to use the travis client.
Pull the latest container image from Docker:
$ docker pull qnimbus/docker-travis-cli
Optional: Add tag to the image:
$ docker tag qnimbus/docker-travis-cli travis-cli
To run the container:
$ docker run --rm travis-cli version
To run the container and volume mount the pwd:
$ docker run --rm --volume $(pwd):/travis travis-cli lint .travis.yml
$ docker run --rm --volume $(pwd):/travis travis-cli status
Ensure that you are in the correct working dir (the github repository you are working on)
Start interactive session on the travis-cli container:
$ docker run -it --rm --volume $(pwd):/travis --entrypoint /bin/sh travis-cli
Login to TravisCI:
note: to generate a github token go to your settings page with certain permissions
/travis # travis login --org --github-token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Perform commands as authenticated user:
/travis # travis whoami
You are QNimbus (Bas)
For example, to encrypt data:
/travis # travis encrypt DOCKER_PASSWORD --add global.env
To make using the Travis Client a bit easier from the command line you could create an alias, like so:
$ alias travis-cli="docker run --rm --volume $(pwd):/travis travis-cli"
$ alias travis-clii="docker run -it --rm --volume $(pwd):/travis --entrypoint /bin/sh travis-cli"
This enables you to run:
$ travis-cli status
Or to start the interactive client:
$ travis-clii
/travis #
To remove the aliases later on:
$ unalias travis-cli travis-clii
Content type
Image
Digest
Size
42.5 MB
Last updated
over 6 years ago
docker pull qnimbus/docker-travis-cli