parent
f3deca41d7
commit
2314c82a1a
2 changed files with 18 additions and 6 deletions
|
|
@ -160,6 +160,14 @@ jobs:
|
|||
command: |
|
||||
git submodule init
|
||||
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:
|
||||
keys:
|
||||
- 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 tag "$image_name:$latest_tag" "$image_name:$image_tag"
|
||||
rm -f bb
|
||||
unzip "/tmp/release/babashka-${image_tag}-linux-static-amd64.zip"
|
||||
docker build -t "$image_name:alpine" -f Dockerfile.alpine .
|
||||
docker tag "$image_name:alpine" "$image_name:$image_tag-alpine"
|
||||
if [[ $snapshot == "false" ]]; then
|
||||
unzip "/tmp/release/babashka-${image_tag}-linux-static-amd64.zip"
|
||||
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
|
||||
if [ "false" = "$snapshot" ]; then
|
||||
echo "Pushing image $image_name:$latest_tag"
|
||||
docker push "$image_name:$latest_tag"
|
||||
echo "Pushing image $image_name:alpine"
|
||||
docker push "$image_name:alpine"
|
||||
fi
|
||||
echo "Pushing image $image_name:alpine"
|
||||
docker push "$image_name:alpine"
|
||||
# we update the version tag, even if it's a SNAPSHOT version
|
||||
echo "Pushing image $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
|
||||
echo "Not publishing Docker image"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue