diff --git a/.travis.yml b/.travis.yml index 91887c8..97f721b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ jobs: - bash -c 'shopt -s globstar; shellcheck **/*.sh' - &build stage: build - env: VERSION_SHORT=0.17 EXTRA_TAG=latest,stable + env: VERSION_SHORT=0.17 EXTRA_TAG=latest STABLE=0.17.74 script: - ./build.sh $VERSION_SHORT - <<: *build diff --git a/README.md b/README.md index 854744e..fc7606f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Factorio [![Build Status](https://travis-ci.org/factoriotools/factorio-docker.svg?branch=master)](https://travis-ci.org/factoriotools/factorio-docker) [![Docker Version](https://images.microbadger.com/badges/version/factoriotools/factorio.svg)](https://hub.docker.com/r/factoriotools/factorio/) [![Docker Pulls](https://img.shields.io/docker/pulls/factoriotools/factorio.svg?maxAge=600)](https://hub.docker.com/r/factoriotools/factorio/) [![Docker Stars](https://img.shields.io/docker/stars/factoriotools/factorio.svg?maxAge=600)](https://hub.docker.com/r/factoriotools/factorio/) [![Microbadger Layers](https://images.microbadger.com/badges/image/factoriotools/factorio.svg)](https://microbadger.com/images/factoriotools/factorio "Get your own image badge on microbadger.com") * `0.17.75`, `0.17`, `latest` [(0.17/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.17/Dockerfile) -* `0.17.75` `stable` [(0.17/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.17/Dockerfile) +* `0.17.74` `stable` [(0.17/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.17/Dockerfile) * `0.16.51`, `0.16` [(0.16/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.16/Dockerfile) * `0.15.40`, `0.15` [(0.15/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.15/Dockerfile) * `0.14.23`, `0.14` [(0.14/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.14/Dockerfile) diff --git a/build.sh b/build.sh index 93a9e20..b48e242 100755 --- a/build.sh +++ b/build.sh @@ -41,6 +41,10 @@ else TAGS+=" -t $DOCKER_REPO:$TAG" done fi + + if [[ ${STABLE:-} == "$VERSION" ]]; then + TAGS+=" -T $DOCKER_REPO:stable" + fi fi # shellcheck disable=SC2068 @@ -53,7 +57,7 @@ fi # only push when: # latest changes where made in the folder corosponding to the version we build, we are on master and don#t build a PR. -if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ $TRAVIS_BRANCH == master ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] || +if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ ${TRAVIS_BRANCH:-} == master ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] || # we build a tag and we are not on master [[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]] && [[ ${TRAVIS_PULL_REQUEST_BRANCH:-} == "" ]] || # we are not in CI @@ -85,5 +89,9 @@ if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ $TRA done fi + if [[ ${STABLE:-} == "$VERSION" ]]; then + docker push "$DOCKER_REPO:stable" + fi + curl -X POST https://hooks.microbadger.com/images/factoriotools/factorio/TmmKGNp8jKcFqZvcJhTCIAJVluw= fi