mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-07-01 22:48:26 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
afd636fc3f | |||
a2849b016a |
12
build.sh
12
build.sh
@ -53,16 +53,16 @@ fi
|
|||||||
eval docker build . ${TAGS[@]}
|
eval docker build . ${TAGS[@]}
|
||||||
docker images
|
docker images
|
||||||
|
|
||||||
|
# remove -1 from incremental tag
|
||||||
|
# eg before: 0.18.24-1, after 0.18.24
|
||||||
if [[ ${TRAVIS_BRANCH:-} ]]; then
|
if [[ ${TRAVIS_BRANCH:-} ]]; then
|
||||||
TRAVIS_BRANCH_VERSION=${TRAVIS_BRANCH%-*}
|
TRAVIS_BRANCH_VERSION=${TRAVIS_BRANCH%-*}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# only push when:
|
# 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.
|
# or we build a tag and we don't build a PR
|
||||||
if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ ${TRAVIS_BRANCH:-} == master ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] ||
|
if [[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]] && [[ ${TRAVIS_PULL_REQUEST_BRANCH:-} == "" ]] ||
|
||||||
# we build a tag and we are not on master
|
# or we are not in CI
|
||||||
[[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]] && [[ ${TRAVIS_PULL_REQUEST_BRANCH:-} == "" ]] ||
|
|
||||||
# we are not in CI
|
|
||||||
[[ -z ${CI:-} ]]; then
|
[[ -z ${CI:-} ]]; then
|
||||||
|
|
||||||
if [[ ${CI:-} == true ]]; then
|
if [[ ${CI:-} == true ]]; then
|
||||||
@ -77,10 +77,12 @@ if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ ${TR
|
|||||||
# fi
|
# fi
|
||||||
|
|
||||||
# push an incremental tag
|
# push an incremental tag
|
||||||
|
# eg 0.18.24-1
|
||||||
if [[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]]; then
|
if [[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]]; then
|
||||||
docker push "$DOCKER_REPO:$VERSION"
|
docker push "$DOCKER_REPO:$VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# only push on tags or when manually running the script
|
||||||
if [[ -n ${TRAVIS_TAG:-} ]] || [[ -z ${CI:-} ]]; then
|
if [[ -n ${TRAVIS_TAG:-} ]] || [[ -z ${CI:-} ]]; then
|
||||||
docker push "$DOCKER_REPO:$VERSION"
|
docker push "$DOCKER_REPO:$VERSION"
|
||||||
docker push "$DOCKER_REPO:$VERSION_SHORT"
|
docker push "$DOCKER_REPO:$VERSION_SHORT"
|
||||||
|
Reference in New Issue
Block a user