Skip to content

Commit

Permalink
ci: review
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed May 23, 2024
1 parent 7547074 commit 112b3ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
15 changes: 8 additions & 7 deletions scripts/build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -euo pipefail
THIS_FILE=$(readlink -f "${BASH_SOURCE[0]}")
THIS_DIR=$(dirname "$THIS_FILE")
ROOT_DIR=$(dirname "$THIS_DIR")
WORKSPACE_DIR="$(dirname "$ROOT_DIR")"

. "$THIS_DIR/kash/kash.sh"

Expand All @@ -20,6 +21,7 @@ while getopts "pr:" option; do
;;
r) # report outcome to slack
CI_STEP_NAME=$OPTARG
load_env_files "$WORKSPACE_DIR/development/common/SLACK_WEBHOOK_TOOLS.enc.env"
trap 'slack_ci_report "$ROOT_DIR" "$CI_STEP_NAME" "$?" "$SLACK_WEBHOOK_TOOLS"' EXIT
;;
*)
Expand All @@ -30,25 +32,24 @@ done
## Init workspace
##

WORKSPACE_DIR="$(dirname "$ROOT_DIR")"
GIT_TAG=$(get_git_tag "$ROOT_DIR")

load_env_files "$WORKSPACE_DIR/development/common/kalisio_dockerhub.enc.env" "$WORKSPACE_DIR/development/common/SLACK_WEBHOOK_TOOLS.enc.env"
load_env_files "$WORKSPACE_DIR/development/common/kalisio_dockerhub.enc.env"
load_value_files "$WORKSPACE_DIR/development/common/KALISIO_DOCKERHUB_PASSWORD.enc.value"

## Build container
##

IMAGE_NAME="kalisio/kdk-keycloak-themes"
IMAGE_NAME="$KALISIO_DOCKERHUB_URL/kalisio/kdk-keycloak-themes"
if [[ -z "$GIT_TAG" ]]; then
IMAGE_TAG=latest
else
IMAGE_TAG=$GIT_TAG
fi

begin_group "Building container ${IMAGE_NAME}:${IMAGE_TAG}"
begin_group "Building container $IMAGE_NAME:$IMAGE_TAG ..."

docker login --username "$KALISIO_DOCKERHUB_USERNAME" --password-stdin < "$KALISIO_DOCKERHUB_PASSWORD"
docker login --username "$KALISIO_DOCKERHUB_USERNAME" --password-stdin "$KALISIO_DOCKERHUB_URL" < "$KALISIO_DOCKERHUB_PASSWORD"
# DOCKER_BUILDKIT is here to be able to use Dockerfile specific dockerginore (app.Dockerfile.dockerignore)
DOCKER_BUILDKIT=1 docker build \
-f Dockerfile \
Expand All @@ -59,6 +60,6 @@ if [ "$PUBLISH" = true ]; then
docker push "$IMAGE_NAME:$IMAGE_TAG"
fi

docker logout
docker logout "$KALISIO_DOCKERHUB_URL"

end_group "Building container ..."
end_group "Building container $IMAGE_NAME:$IMAGE_TAG ..."
2 changes: 1 addition & 1 deletion scripts/kash
Submodule kash updated 2 files
+160 −12 kash.sh
+12 −0 scripts/run_tests.sh
3 changes: 0 additions & 3 deletions scripts/setup_workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ ROOT_DIR=$(dirname "$THIS_DIR")

. "$THIS_DIR/kash/kash.sh"

WORKSPACE_BRANCH=
WORKSPACE_TAG=

begin_group "Setting up workspace ..."

if [ "$CI" = true ]; then
Expand Down

0 comments on commit 112b3ea

Please sign in to comment.