From 5dbcd66ee2487adc6509edfa0fe3d98cbcd3068d Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Tue, 11 May 2021 16:50:21 +0100 Subject: [PATCH] onap-oom-helm-build: update build wrapper and upload scripts Change-Id: Icb0f797cafc1f9e5bbd27b33c716161fd101ef93 Signed-off-by: Cian Johnston --- jjb/cloud-infra/engine-macros.yaml | 6 ++++ .../scripts/oom-build-installdeps.sh | 30 +++++++++++++++++++ jjb/cloud-infra/scripts/oom-build-wrapper.sh | 3 +- jjb/cloud-infra/scripts/oom-upload.sh | 13 ++++---- jjb/onap/oom/oom-build-jobs.yaml | 7 +++-- 5 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 jjb/cloud-infra/scripts/oom-build-installdeps.sh diff --git a/jjb/cloud-infra/engine-macros.yaml b/jjb/cloud-infra/engine-macros.yaml index c28cdcc29..767607287 100644 --- a/jjb/cloud-infra/engine-macros.yaml +++ b/jjb/cloud-infra/engine-macros.yaml @@ -164,6 +164,12 @@ - shell: !include-raw: ./scripts/xtesting-healthcheck.sh +- builder: + name: 'oom-build-installdeps-macro' + builders: + - shell: + !include-raw: ./scripts/oom-build-installdeps.sh + - builder: name: 'oom-build-wrapper-macro' builders: diff --git a/jjb/cloud-infra/scripts/oom-build-installdeps.sh b/jjb/cloud-infra/scripts/oom-build-installdeps.sh new file mode 100644 index 000000000..85b0dae96 --- /dev/null +++ b/jjb/cloud-infra/scripts/oom-build-installdeps.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# ============LICENSE_START======================================================= +# Copyright (C) 2021 The Nordix Foundation. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +# This is a wrapper to install any required dependencies for running the OOM helm +# build script. + +set -o errexit +set -o pipefail + +sudo apt-get install -y -q=3 \ + make + +# vim: set ts=2 sw=2 expandtab: diff --git a/jjb/cloud-infra/scripts/oom-build-wrapper.sh b/jjb/cloud-infra/scripts/oom-build-wrapper.sh index 2c84ddfff..f4dadc763 100644 --- a/jjb/cloud-infra/scripts/oom-build-wrapper.sh +++ b/jjb/cloud-infra/scripts/oom-build-wrapper.sh @@ -23,8 +23,7 @@ set -o errexit set -o pipefail -OOM_ROOT_DIR="${WORKSPACE}/oom" -cd "${OOM_ROOT_DIR}" +cd "${WORKSPACE}" ./oom-build.sh # vim: set ts=2 sw=2 expandtab: diff --git a/jjb/cloud-infra/scripts/oom-upload.sh b/jjb/cloud-infra/scripts/oom-upload.sh index 6e9e6c4ea..ce3afb3b2 100644 --- a/jjb/cloud-infra/scripts/oom-upload.sh +++ b/jjb/cloud-infra/scripts/oom-upload.sh @@ -21,17 +21,20 @@ set -o errexit set -o pipefail -ONAP_UMBRELLA_CHART="${WORKSPACE}/build/onap-oom/kubernetes/dist/packages/onap-${ONAP_OOM_CHART_VERSION}.tgz" +ONAP_UMBRELLA_CHART="${WORKSPACE}/build/onap-oom/kubernetes/dist/packages/onap-*.tgz" +HELM_BIN="${WORKSPACE}/bin/helm" IMAGES_LIST="${WORKSPACE}/images.txt" +ONAP_OOM_GIT_REVISION=$(cd "${WORKSPACE}/build/onap-oom" && git rev-parse --short HEAD) export NORDIX_ARM_REPO="nordix-oom" export ARTIFACT_ARM_FOLDER="oom" export BUILD_IDENTIFIER="${ONAP_OOM_GIT_REVISION}" export NORDIX_ARTIFACT_URL="${NORDIX_ARM_HTTPS_URL}/${NORDIX_ARM_REPO}/${ARTIFACT_ARM_FOLDER}/${BUILD_IDENTIFIER}" -echo "Info : Pushing ONAP umbrella chart to Nordix Harbor" -${HELM_BIN} push "${ONAP_UMBRELLA_CHART}" "${NORDIX_REGISTRY}" +# NOTE(cian): Leaving this commented out for the moment. +#echo "Info : Pushing ONAP umbrella chart to Nordix Harbor" +#${HELM_BIN} push "${ONAP_UMBRELLA_CHART}" "${NORDIX_REGISTRY}" -export BUILD_ARTIFACTS="${IMAGES_LIST}" +export BUILD_ARTIFACTS="${ONAP_UMBRELLA_CHART} ${IMAGES_LIST}" echo "Info : Uploading ${BUILD_ARTIFACTS} to Nordix ARM ${NORDIX_ARM_REPO} repository" for BUILD_ARTIFACT in $BUILD_ARTIFACTS; do echo "Info : Generating checksums for $BUILD_ARTIFACT" @@ -39,7 +42,7 @@ for BUILD_ARTIFACT in $BUILD_ARTIFACTS; do ARTIFACT_SHASUM=$(shasum "${BUILD_ARTIFACT}" | cut -d' ' -f1) ARTIFACT_SHA256SUM=$(sha256sum "${BUILD_ARTIFACT}" | cut -d' ' -f1) - REMOTE_ARTIFACT=$(echo "${BUILD_ARTIFACT}" | sed 's/.*\///g') + REMOTE_ARTIFACT=$(basename "${BUILD_ARTIFACT}") echo "Info : Uploading ${BUILD_ARTIFACT} to Nordix Artifactory" curl -s -S \ diff --git a/jjb/onap/oom/oom-build-jobs.yaml b/jjb/onap/oom/oom-build-jobs.yaml index 4534e7e0e..be51c520b 100644 --- a/jjb/onap/oom/oom-build-jobs.yaml +++ b/jjb/onap/oom/oom-build-jobs.yaml @@ -124,14 +124,14 @@ scm: - git-scm-gerrit: ssh-credentials-id: nordixinfra-nordix-gerrit-ssh - branch: $GERRIT_BRANCH - refspec: $GERRIT_REFSPEC + branch: '{branch}' + refspec: '+refs/heads/{branch}:refs/remotes/origin/{branch}' wipe_workspace: true clean_before: false wrappers: - build-timeout: - timeout: 10 + timeout: 600 - nordixinfra-harbor-creds-wrapper - credentials-binding: - username-password-separated: @@ -142,6 +142,7 @@ - fix-workspace-permissions builders: + - 'oom-build-installdeps-macro' - 'oom-build-wrapper-macro' - 'oom-upload-macro' -- 2.25.1