intelliops/travis-release

By intelliops

Updated over 6 years ago

Automated releasing through Travis for Docker containers and designed for builds on Docker Hub.

Image

17

docker-travis-release

Template for automated Docker image builds using Travis

How to use

Your repository should include the following files as a minimum to make it all work:

.travis.yml
Dockerfile
release.sh

At the moment no support yet for multiple Dockerfiles, create a ticket if needed

Copy the release.sh file into your repository, make sure it has the proper permissions so that Travis can execute it.

chmod 775 release.sh

Modify release.sh variables which are declared on top of the file:

GH_USER='belsander'
GH_REPO='docker-travis-release'
VERSION_CMD="docker run -ti intelliops/travis-release:latest \
  /bin/bash -c 'echo 1.0.4'"
VERSION_FILE='VERSION'
VariableDescription
GH_USERYour Github username (or organisation name)
GH_REPOThe name of your Github repository (DO NOT INCLUDE .git EXTENSION)
VERSION_CMDThe command that will get the version of the service your are shipping with your container
VERSION_FILEThe name of the file where the VERSION will be stored into, best left untouched

Make sure to strip any whitespace characters from the output of VERSION_CMD

Copy the .travis.yml file into your repository and modify it to your needs. The most import part has to stay unchanged though:

after_success:
  - if [[ "$TRAVIS_BRANCH" == "master" ]]; then ./release.sh; fi

Docker Pull Command

docker pull intelliops/travis-release