Skip to content

Commit

Permalink
More cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Nov 16, 2024
1 parent c7a4d87 commit 00ab4a8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions kaniko.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ source $(dirname "${BASH_SOURCE[0]}")/local-setup.sh
# REGISTRY: openshift-image-registry.apps.cluster.chp4.io.

#echo "Registry: ${REGISTRY}"
#KANIKO_IMAGE=npo-poms/kaniko
KANIKO_IMAGE=ghcr.io/npo-poms/kaniko:main
KANIKO_IMAGE=npo-poms/kaniko
#KANIKO_IMAGE=ghcr.io/npo-poms/kaniko:main

docker run -v ~/conf:/root/conf -v ~/.docker:/root/.docker -v "$(pwd)":/workspace \
-e PROJECT_VERSION="$PROJECT_VERSION" \
Expand Down
3 changes: 0 additions & 3 deletions local-setup.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Sets up some environment as gitlab would do.
# included by kaniko.sh and by local-setup.sh

REGISTRY=${REGISTRY:-registry.npohosting.nl}
NAMESPACE=${NAMESPACE:-poms}

CI_COMMIT_REF_NAME="$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match)"
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Found project version ${PROJECT_VERSION}"
Expand Down
7 changes: 7 additions & 0 deletions scripts/kaniko-functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
##!/bin/sh
KANIKO_ARGS=${KANIKO_ARGS:-'--cache=true --cache-copy-layers=true'}
REGISTRY="${REGISTRY:-registry.npohosting.nl}"
NAMESPACE=${NAMESPACE:-poms}
DOCKER_BUILD_ARGS=${DOCKER_BUILD_ARGS:-} # Uses eval, when overriding escape whitespace: '--build-arg\ "FOO=BAR"'
DOCKER_AUTH_CONFIG_FILE=$HOME/.docker/config-gitlab.json


if ! type os_app_name &> /dev/null; then
. "$KANIKO_SCRIPTS"dockerfile-functions.sh
fi
Expand Down
3 changes: 3 additions & 0 deletions scripts/kaniko-gitlab-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

echo "kaniko gitlab functions"

AS_LATEST=${AS_LATEST:-'false'}


# shellcheck source=${KANIKO_SCRIPTS}kaniko-functions.sh
if ! type os_app_name &> /dev/null ; then
. "$KANIKO_SCRIPTS"kaniko-functions.sh
Expand Down
13 changes: 6 additions & 7 deletions scripts/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ echo "--------"
export DOCKER_DIR
DOCKER_DIR="$(pwd)"
echo "Executing in ${DOCKER_DIR}"
export DOCKER_BUILD_ARGS= # Uses eval, when overriding escape whitespace: '--build-arg\ "FOO=BAR"'
export REGISTRY="${REGISTRY:-registry.npohosting.nl}"
export DOCKER_AUTH_CONFIG_FILE=$HOME/.docker/config-gitlab.json
export KANIKO_ARGS='--cache=true --cache-copy-layers=true'
export AS_LATEST='false'
export TRACE='false'

echo Using registry ${REGISTRY}
TRACE=${TRACE:-'false'}

if [ "$TRACE" = 'true' ]; then
set -x
fi

echo Using registry ${REGISTRY}
. "$KANIKO_SCRIPTS"kaniko-gitlab-functions.sh

. "$KANIKO_SCRIPTS"kaniko-maven.sh
Expand Down

0 comments on commit 00ab4a8

Please sign in to comment.