project-bluebird / bluebird

Server to communicate with NATS air traffic simulator and Bluesky
MIT License
10 stars 4 forks source link

Automatic Docker build upon push for master and release branches #73

Closed tallamjr closed 4 years ago

tallamjr commented 4 years ago

Fixes #72

This PR automatically builds a new docker image upon successful completion of tests on the master and release branches. Depending which branch is it on, either the latest or release number will be used as the docker image tag.

This has almost been completely tested , except for the situation of pushing the new build.

For this reason an early PR has been created such that this can be inspected and perhaps given the go ahead to test on a dummy release branch.

Note, the issue/72/CI-image-build branch was branched off release/1.3.0

tallamjr commented 4 years ago

The things that will need to change if this PR is approved is to uncomment the code lines found in .travis-build.sh :

...
if [ $TRAVIS_BRANCH = "master" ]; then
    docker build --tag=bluebird .
    docker tag bluebird turinginst/bluebird:latest
    # docker push turinginst/bluebird:latest
fi
...

and

...
if [[ $TRAVIS_BRANCH == release* ]]; then
    echo $TRAVIS_BRANCH
    RELEASE_VERSION=`echo $TRAVIS_BRANCH | awk -F/ '{print $NF}'`
    echo $RELEASE_VERSION
    docker build --tag=bluebird .
    docker tag bluebird turinginst/bluebird:$RELEASE_VERSION
    # docker push turinginst/bluebird:$RELEASE_VERSION
fi
...