Skip to content

Commit

Permalink
ci: handle an additional custom field in tag/branch names
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed Jan 14, 2025
1 parent a7d702f commit 5da2d06
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions scripts/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ init_app_infos "$ROOT_DIR" "$WORKSPACE_DIR/development/workspaces/apps"
APP=$(get_app_name)
VERSION=$(get_app_version)
FLAVOR=$(get_app_flavor)
CUSTOM=$(get_app_custom)
[[ "$CUSTOM" != "" ]] && CUSTOM="-$CUSTOM"

echo "About to build $APP v$VERSION-$FLAVOR ..."
echo "About to build $APP v$VERSION-$FLAVOR$CUSTOM..."

load_env_files "$WORKSPACE_DIR/development/common/kalisio_dockerhub.enc.env"
load_value_files "$WORKSPACE_DIR/development/common/KALISIO_DOCKERHUB_PASSWORD.enc.value"
Expand All @@ -62,7 +64,7 @@ cp "$KLI_FILE" "$WORKSPACE_DIR/kli.js"
echo "Will use kli file $KLI_FILE to install and link modules ..."

IMAGE_NAME="$KALISIO_DOCKERHUB_URL/kalisio/$APP"
IMAGE_TAG="$VERSION-$FLAVOR-node$NODE_VER-$DEBIAN_VER"
IMAGE_TAG="$VERSION-$FLAVOR$CUSTOM-node$NODE_VER-$DEBIAN_VER"
DEBUG=

case "$FLAVOR" in
Expand Down Expand Up @@ -90,15 +92,14 @@ DOCKER_BUILDKIT=1 docker build \
-f app.Dockerfile \
-t "$IMAGE_NAME:$IMAGE_TAG" \
"$WORKSPACE_DIR"
docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:$FLAVOR"

if [ "$PUBLISH" = true ]; then
docker push "$IMAGE_NAME:$IMAGE_TAG"
if [ "$NODE_VER" = "$DEFAULT_NODE_VER" ] && [ "$DEBIAN_VER" = "$DEFAULT_DEBIAN_VER" ]; then
docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:$VERSION-$FLAVOR"
docker push "$IMAGE_NAME:$VERSION-$FLAVOR"
docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:$FLAVOR"
docker push "$IMAGE_NAME:$FLAVOR"
docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:$VERSION-$FLAVOR$CUSTOM"
docker push "$IMAGE_NAME:$VERSION-$FLAVOR$CUSTOM"
docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:$FLAVOR$CUSTOM"
docker push "$IMAGE_NAME:$FLAVOR$CUSTOM"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/kash
Submodule kash updated 3 files
+10 −0 CHANGELOG.md
+137 −143 kash.sh
+28 −1 scripts/run_tests.sh

0 comments on commit 5da2d06

Please sign in to comment.