From b26d2766a2ba415ffef3a51a17e18039af3a95b8 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Mon, 14 Jun 2021 20:01:41 +1000 Subject: [PATCH] Build tweaks --- Jenkinsfile | 15 +++++---------- scripts/buildx | 7 ++++--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cfe6c212..5e8f0d34 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -141,29 +141,24 @@ pipeline { archiveArtifacts(artifacts: 'docs/docs.tgz', allowEmptyArchive: false) } } - /* stage('MultiArch Build') { when { - allOf { - branch 'master' - not { - equals expected: 'UNSTABLE', actual: currentBuild.result - } + not { + equals expected: 'UNSTABLE', actual: currentBuild.result } } steps { withCredentials([string(credentialsId: 'npm-sentry-dsn', variable: 'SENTRY_DSN')]) { withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) { + // Docker Login sh "docker login -u '${duser}' -p '${dpass}'" - // Buildx to local files - // sh './scripts/buildx -o type=local,dest=docker-build' - // Buildx to with push + // Buildx with push from cache sh "./scripts/buildx --push ${BUILDX_PUSH_TAGS}" + // sh './scripts/buildx -o type=local,dest=docker-build' } } } } - */ stage('Docs Deploy') { when { allOf { diff --git a/scripts/buildx b/scripts/buildx index 24e18874..2738798c 100755 --- a/scripts/buildx +++ b/scripts/buildx @@ -1,11 +1,11 @@ -#!/bin/bash -e +#!/bin/bash DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" . "$DIR/.common.sh" echo -e "${BLUE}❯ ${CYAN}Building docker multiarch: ${YELLOW}${*}${RESET}" -cd "${DIR}/.." +cd "${DIR}/.." || exit 1 # determine commit if not already set if [ "$BUILD_COMMIT" == "" ]; then @@ -31,6 +31,7 @@ docker buildx build \ $@ \ . +rc=$? docker buildx rm "${BUILDX_NAME:-npm}" - echo -e "${BLUE}❯ ${GREEN}Multiarch build Complete${RESET}" +exit $rc