onap-oom-helm-build: update build wrapper and upload scripts 23/8723/2
authorCian Johnston <cian.johnston@est.tech>
Tue, 11 May 2021 15:50:21 +0000 (16:50 +0100)
committerCian Johnston <cian.johnston@est.tech>
Wed, 12 May 2021 08:21:06 +0000 (09:21 +0100)
Change-Id: Icb0f797cafc1f9e5bbd27b33c716161fd101ef93
Signed-off-by: Cian Johnston <cian.johnston@est.tech>
jjb/cloud-infra/engine-macros.yaml
jjb/cloud-infra/scripts/oom-build-installdeps.sh [new file with mode: 0644]
jjb/cloud-infra/scripts/oom-build-wrapper.sh
jjb/cloud-infra/scripts/oom-upload.sh
jjb/onap/oom/oom-build-jobs.yaml

index c28cdcc299921b08e78f8af0a42ebd945923f7bf..76760728777dc77c293fd14b2a9ecf2763733501 100644 (file)
       - 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 (file)
index 0000000..85b0dae
--- /dev/null
@@ -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:
index 2c84ddfff90a486526c376e11ae6cf056bb3b8e5..f4dadc763805d288642ce8299426e53b472f3ea5 100644 (file)
@@ -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:
index 6e9e6c4ea3296da5ce7ea68145d3a1e3c3abdaba..ce3afb3b216350f13f15d1f0cc1c96caaa226a0c 100644 (file)
 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 \
index 4534e7e0ea4111f28c541efc05ac992199d5fa42..be51c520b3a9944f29140f942d26bc737717139d 100644 (file)
     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:
       - fix-workspace-permissions
 
     builders:
+      - 'oom-build-installdeps-macro'
       - 'oom-build-wrapper-macro'
       - 'oom-upload-macro'