From be006a7f050591fc3c2a30bde37276d580cdaccc Mon Sep 17 00:00:00 2001 From: Gibson Chikafa Date: Thu, 17 Oct 2024 11:35:38 +0200 Subject: [PATCH] Fix Jenkinsfile to also build webhook and controller images --- Jenkinsfile | 17 ++++++++++++++--- deploy/kubernetes/docker/build.sh | 2 +- version.txt | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5775c95e54..59fb65e40a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,9 @@ pipeline { environment { VERSION = readFile "${env.WORKSPACE}/version.txt" BUILD_BRANCH = readFile "${env.WORKSPACE}/build_branch.txt" + DOCKER_REGISTRY = "docker.hops.works" + CONTROLLER_IMAGE = "${DOCKER_REGISTRY}/hopsworks/rss-controller:${VERSION}" + WEBHOOK_IMAGE = "${DOCKER_REGISTRY}/hopsworks/rss-webhook:${VERSION}" } stages { stage("checkout") { @@ -26,18 +29,26 @@ pipeline { sh """ set -ex echo "Building RSS version ${VERSION} on branch ${BUILD_BRANCH}" - docker login -u ${NEXUS_CREDS_USR} -p ${NEXUS_CREDS_PSW} docker.hops.works + docker login -u ${NEXUS_CREDS_USR} -p ${NEXUS_CREDS_PSW} $DOCKER_REGISTRY ./build_distribution.sh --spark3-profile spark3 --hadoop-profile hadoop3.2 --without-dashboard cd deploy/kubernetes/docker || exit - ./build.sh --hadoop-version 3.2.0.14-EE-RC0 --registry docker.hops.works --nexus-user $NEXUS_CREDS_USR --nexus-password $NEXUS_CREDS_PSW + ./build.sh --hadoop-version 3.2.0.14-EE-RC0 --registry $DOCKER_REGISTRY --nexus-user $NEXUS_CREDS_USR --nexus-password $NEXUS_CREDS_PSW cd ../../.. mkdir -p /opt/repository/master/rss/${VERSION}/ cp client-spark/spark3-shaded/target/rss-client-spark3-shaded-${VERSION}.jar /opt/repository/master/rss/${VERSION}/ + + # build the controller and webhook images + cd deploy/kubernetes/operator || exit 1 + docker build . --progress=plain -t $CONTROLLER_IMAGE --build-arg MODULE=controller -f hack/Dockerfile + docker build . --progress=plain -t $WEBHOOK_IMAGE --build-arg MODULE=webhook -f hack/Dockerfile + # push the controller and webhook images + docker push $CONTROLLER_IMAGE + docker push $WEBHOOK_IMAGE """ } } } } -} +} \ No newline at end of file diff --git a/deploy/kubernetes/docker/build.sh b/deploy/kubernetes/docker/build.sh index 09ef3ee00b..68269f3e77 100755 --- a/deploy/kubernetes/docker/build.sh +++ b/deploy/kubernetes/docker/build.sh @@ -140,7 +140,7 @@ GIT_COMMIT=$(git describe --dirty --always --tags | sed 's/-/./g') IMAGE_VERSION=$(cat $RSS_DIR/version.txt | awk '{$1=$1; print}' | sed '/^$/d') IMAGE=$REGISTRY/rss-server:$IMAGE_VERSION echo "image version: ${IMAGE_VERSION}" -IMAGE=$REGISTRY/rss:$IMAGE_VERSION +IMAGE=$REGISTRY/hopsworks/rss:$IMAGE_VERSION echo "building image: $IMAGE" DOCKER_BUILDKIT=1 docker build --network=host -t "$IMAGE" \ diff --git a/version.txt b/version.txt index 899f24fc75..f514a2f0bd 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.9.0 \ No newline at end of file +0.9.1 \ No newline at end of file