diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index dbc9d10415..342ba65be4 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -7,7 +7,7 @@ steps: - label: ":floppy_disk: upload image" command: ".buildkite/steps/publish-image.sh" - branches: "master alfa develop ci-*" + branches: "master alfa develop ci-* v*.*.*" - wait diff --git a/.buildkite/steps/.build-image.sh.swp b/.buildkite/steps/.build-image.sh.swp deleted file mode 100644 index 889b651e35..0000000000 Binary files a/.buildkite/steps/.build-image.sh.swp and /dev/null differ diff --git a/.buildkite/steps/build-image.sh b/.buildkite/steps/build-image.sh index a3ba4e84d5..0a018b7f16 100755 --- a/.buildkite/steps/build-image.sh +++ b/.buildkite/steps/build-image.sh @@ -4,6 +4,9 @@ set -euo pipefail IMAGETAG=${BUILDKITE_BRANCH:-master} BRANCHNAME=${BUILDKITE_BRANCH:-master} +TAGREF=${BUILDKITE_TAG:+"tags/$BUILDKITE_TAG"} +REF=${TAGREF:-"heads/$BUILDKITE_BRANCH"} + if [[ "${IMAGETAG}" == "master" ]]; then BUILDTYPE="stable" elif [[ "${IMAGETAG}" == "alfa" ]]; then @@ -13,4 +16,4 @@ else fi cd docker -docker build -t cyberway/cyberway.cdt:${IMAGETAG} --build-arg branch=${BRANCHNAME} --build-arg buildtype=${BUILDTYPE} . +docker build -t cyberway/cyberway.cdt:${IMAGETAG} --build-arg branch=${BRANCHNAME} --build-arg buildtype=${BUILDTYPE} --build-arg ref=${REF} . diff --git a/docker/Dockerfile b/docker/Dockerfile index 990b7b3e37..1324dcb10b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,8 +2,9 @@ ARG buildtype=stable FROM cyberway/builder:$buildtype as builder ARG branch=master +ARG ref=heads/$branch -ADD https://api.github.com/repos/cyberway/cyberway.cdt/git/refs/heads/$branch /etc/version.json +ADD https://api.github.com/repos/cyberway/cyberway.cdt/git/refs/$ref /etc/version.json RUN git clone -b $branch https://github.com/cyberway/cyberway.cdt.git --recursive