mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-01-13 03:37:10 +01:00
ci: improve doc
This commit is contained in:
parent
4e261043cd
commit
a2849b016a
6
build.sh
6
build.sh
@ -53,12 +53,14 @@ 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.
|
# latest changes where made in the folder corresponding 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
|
# we build a tag and we are not on master
|
||||||
[[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]] && [[ ${TRAVIS_PULL_REQUEST_BRANCH:-} == "" ]] ||
|
[[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]] && [[ ${TRAVIS_PULL_REQUEST_BRANCH:-} == "" ]] ||
|
||||||
@ -77,10 +79,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"
|
||||||
|
Loading…
Reference in New Issue
Block a user