Skip to content

Commit

Permalink
ci: use short commit sha instead of build number [skip tests]
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed Mar 15, 2024
1 parent b509627 commit 77dc07e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
23 changes: 1 addition & 22 deletions scripts/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,6 @@ ROOT_DIR=$(dirname "$THIS_DIR")

. "$THIS_DIR/kash/kash.sh"

get_ci_build_number() {
if [ "$CI" != true ]; then
# 0 is the build number you get in dev mode
echo "0"
else
case "$CI_ID" in
github)
echo "$GITHUB_RUN_NUMBER.$GITHUB_RUN_ATTEMPT"
;;
gitlab)
echo "$CI_JOB_ID"
;;
travis)
echo "$TRAVIS_BUILD_NUMBER"
;;
*)
;;
esac
fi
}

## Parse options
##

Expand Down Expand Up @@ -82,7 +61,7 @@ docker login --username "$KALISIO_DOCKERHUB_USERNAME" --password-stdin < "$KALIS
DOCKER_BUILDKIT=1 docker build \
--build-arg APP="$APP" \
--build-arg FLAVOR="$FLAVOR" \
--build-arg BUILD_NUMBER="$(get_ci_build_number)" \
--build-arg BUILD_NUMBER="$(get_git_commit_short_sha "$ROOT_DIR")" \
-f app.Dockerfile \
-t "$IMAGE_NAME:$IMAGE_TAG" \
"$WORKSPACE_DIR"
Expand Down
2 changes: 1 addition & 1 deletion scripts/kash
Submodule kash updated 1 files
+9 −0 kash.sh

0 comments on commit 77dc07e

Please sign in to comment.