parent
f3deca41d7
commit
2314c82a1a
2 changed files with 18 additions and 6 deletions
|
|
@ -160,6 +160,14 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update
|
git submodule update
|
||||||
|
- run:
|
||||||
|
name: "Short circuit on SNAPSHOT"
|
||||||
|
command: |
|
||||||
|
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||||
|
if [[ "$VERSION" == *-SNAPSHOT ]]
|
||||||
|
then
|
||||||
|
circleci task halt
|
||||||
|
fi
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
- linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||||
|
|
|
||||||
|
|
@ -21,20 +21,24 @@ if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" = "master" ]; then
|
||||||
docker build -t "$image_name" -f Dockerfile.ci .
|
docker build -t "$image_name" -f Dockerfile.ci .
|
||||||
docker tag "$image_name:$latest_tag" "$image_name:$image_tag"
|
docker tag "$image_name:$latest_tag" "$image_name:$image_tag"
|
||||||
rm -f bb
|
rm -f bb
|
||||||
unzip "/tmp/release/babashka-${image_tag}-linux-static-amd64.zip"
|
if [[ $snapshot == "false" ]]; then
|
||||||
docker build -t "$image_name:alpine" -f Dockerfile.alpine .
|
unzip "/tmp/release/babashka-${image_tag}-linux-static-amd64.zip"
|
||||||
docker tag "$image_name:alpine" "$image_name:$image_tag-alpine"
|
docker build -t "$image_name:alpine" -f Dockerfile.alpine .
|
||||||
|
docker tag "$image_name:alpine" "$image_name:$image_tag-alpine"
|
||||||
|
fi
|
||||||
# we only update latest when it's not a SNAPSHOT version
|
# we only update latest when it's not a SNAPSHOT version
|
||||||
if [ "false" = "$snapshot" ]; then
|
if [ "false" = "$snapshot" ]; then
|
||||||
echo "Pushing image $image_name:$latest_tag"
|
echo "Pushing image $image_name:$latest_tag"
|
||||||
docker push "$image_name:$latest_tag"
|
docker push "$image_name:$latest_tag"
|
||||||
|
echo "Pushing image $image_name:alpine"
|
||||||
|
docker push "$image_name:alpine"
|
||||||
fi
|
fi
|
||||||
echo "Pushing image $image_name:alpine"
|
|
||||||
docker push "$image_name:alpine"
|
|
||||||
# we update the version tag, even if it's a SNAPSHOT version
|
# we update the version tag, even if it's a SNAPSHOT version
|
||||||
echo "Pushing image $image_name:$image_tag"
|
echo "Pushing image $image_name:$image_tag"
|
||||||
docker push "$image_name:$image_tag"
|
docker push "$image_name:$image_tag"
|
||||||
docker push "$image_name:$image_tag-alpine"
|
if [[ $snapshot == "false" ]]; then
|
||||||
|
docker push "$image_name:$image_tag-alpine"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Not publishing Docker image"
|
echo "Not publishing Docker image"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue