From 411ab84bc9692e150ccf6776350a50e96b8ed198 Mon Sep 17 00:00:00 2001 From: "robert.tomczyk" Date: Thu, 26 Nov 2020 13:59:49 +0000 Subject: [PATCH] UDS: Remove UDS jobs after migration to Aegis Change-Id: I9d0b041328494741eff4a40b67ce0afdbb993814 --- .../uds-sdc-customization-verify-jobs.yaml | 35 --- jjb/onap/uds/README.md | 50 ---- jjb/onap/uds/scripts/archive-images.sh | 49 ---- jjb/onap/uds/scripts/archive-repos.sh | 40 --- jjb/onap/uds/scripts/collect-artifacts.sh | 58 ---- .../uds/scripts/generate-build-metadata.sh | 59 ---- jjb/onap/uds/scripts/maven-build.sh | 84 ------ jjb/onap/uds/scripts/maven-clean.sh | 41 --- jjb/onap/uds/scripts/pull-repos.sh | 60 ---- jjb/onap/uds/scripts/push-artifacts.sh | 41 --- jjb/onap/uds/scripts/push-images.sh | 41 --- jjb/onap/uds/scripts/push-repos.sh | 41 --- .../uds/uds-daily-build-package-promote.yaml | 262 ------------------ jjb/onap/uds/uds-macros.yaml | 220 --------------- 14 files changed, 1081 deletions(-) delete mode 100644 jjb/onap/uds-sdc-customization/uds-sdc-customization-verify-jobs.yaml delete mode 100644 jjb/onap/uds/README.md delete mode 100644 jjb/onap/uds/scripts/archive-images.sh delete mode 100644 jjb/onap/uds/scripts/archive-repos.sh delete mode 100644 jjb/onap/uds/scripts/collect-artifacts.sh delete mode 100644 jjb/onap/uds/scripts/generate-build-metadata.sh delete mode 100644 jjb/onap/uds/scripts/maven-build.sh delete mode 100644 jjb/onap/uds/scripts/maven-clean.sh delete mode 100644 jjb/onap/uds/scripts/pull-repos.sh delete mode 100644 jjb/onap/uds/scripts/push-artifacts.sh delete mode 100644 jjb/onap/uds/scripts/push-images.sh delete mode 100644 jjb/onap/uds/scripts/push-repos.sh delete mode 100644 jjb/onap/uds/uds-daily-build-package-promote.yaml delete mode 100644 jjb/onap/uds/uds-macros.yaml diff --git a/jjb/onap/uds-sdc-customization/uds-sdc-customization-verify-jobs.yaml b/jjb/onap/uds-sdc-customization/uds-sdc-customization-verify-jobs.yaml deleted file mode 100644 index 5b71dfce..00000000 --- a/jjb/onap/uds-sdc-customization/uds-sdc-customization-verify-jobs.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. -# ================================================================================ -# 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 job gets triggered when a change is proposed to -# ONAP SDC Ericsson customization: uds/sdc-customization project on Nordix Gerrit. - -- project: - name: uds-sdc-customization-verify - project: uds/sdc-customization - project-name: uds-sdc-customization - mvn_params: "-Djacoco.skip=true -DskipPMD -Dcheckstyle.skip=true" - - stream: - - 'master': - branch: '{stream}' - jdk-version: java-11 - - jobs: - - 'local-onap-{project-name}-{stream}-verify-java' diff --git a/jjb/onap/uds/README.md b/jjb/onap/uds/README.md deleted file mode 100644 index 7453feb0..00000000 --- a/jjb/onap/uds/README.md +++ /dev/null @@ -1,50 +0,0 @@ -## Job Descriptions -Jenkins Multijob to build and archive UDS Artifacts (docker images, source repositories, .war files etc.) and pushe to Artifactory. -Can accept multiple project source repositories for instances where repositories depend on each other in order to build. -Intended for use within Aegis. -[Link To Jira Ticket](https://jira.nordix.org/browse/AEGIS-36) - -- uds-verify-package-promote - Multijob root that creates build.properties file to share build parameters and pull project source repositories -- uds-verify - Job that does a Maven build for each project source repository specified -- uds-package-artifacts - Job that gathers file artifacts specified (.war .jar etc.) and places in a directory to be pushed to Artifactory -- uds-package-images - Job archives each docker image using 'docker save' into a tarball and places in a directory to be pushed to Artifactory -- uds-package-repositories - Job that archives the project source repositories into a tarball to be pushed to Artifactory -- uds-promote-* - Jobs that push each of the Artifacts (docker images, source repos and war files etc.) to their specified location within Artifactory - -## Job Parameters -Job parameters include; -- PROJECTS - Nordix Gerrit projects to build and archive (e.g. project1, project2) -- BRANCHES - Project branches to pull from (e.g. project1branch, project2branch) -- PROJECT_DIRECTORIES - Directories names to place projects -- PROJECT_VERSIONS - SHA commit ids/versions of PROJECTS source repositories to checkout e.g. 6d3ab..., d96ba... Allows for building from specific versions of a source or can also be left blank to pull latest source. -- GIT_BASE_HTTPS - Base HTTPS URL of repository to clone from - -- MVN_VERSION - Maven version to build with -- MVN_URL - Download URL for Maven -- MVN - Path to mvn executable -- MVN_PARAMS - Maven build parameters -- MVN_SETTINGS_XML_VERSION - SHA commit id/version for the ONAP oparent repository to checkout. Used for retrieving the ONAP Maven settings.xml file for the Maven build process. Can be left blank to pull the latest version. - -- ARTIFACTORY_URL - Artifactory URL to push to -- POM_LOCATION - Path to repository pom.xml parsed for version number used within archive filenames (e.g. uds.version) -- GREP_PARAMS - Parameters for grep command used for parsing pom file for version number used within archive filenames - -- ARCHIVENAME - Name to be given to archive holding the repositories pushed to Artifactory -- ARTIFACTORY_REPO_ARCHIVE_PATH - Artifactory repository and path to push repository archive to -- REPO_ARCHIVE_ARTIFACT_DIRECTORY - Workspace directory to hold repository artifacts - -- DOCKER_IMAGES - Docker image names to archive and push to Artifactory -- ARTIFACTORY_DOCKER_IMAGES_PATH - Artifactory repository and path to push docker images to -- DOCKER_IMAGE_ARTIFACT_DIRECTORY - Workspace directory to hold docker image artifacts - -- ARTIFACT_PATHS - Artifact file paths that should be pushed to Artifactory, can contain wildcards -- ARTIFACTORY_ARTIFACT_PATH - Artifactory repository and path to push artifacts to e.g. .war .jar files -- ARTIFACT_DIRECTORY - Workspace directory to hold artifacts - - -## Job Requirements -Jenkins Job requires the following packages installed on the Jenkins slave - - Maven (tested with v3.6.0) - - Docker (tested with v3.3.9) - - Java (tested with 1.8.0) - For further information about building SDC see [link](https://wiki.onap.org/pages/viewpage.action?pageId=16004156) diff --git a/jjb/onap/uds/scripts/archive-images.sh b/jjb/onap/uds/scripts/archive-images.sh deleted file mode 100644 index 3c330d6a..00000000 --- a/jjb/onap/uds/scripts/archive-images.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -# Make directory to hold docker image artifacts -mkdir -p $DOCKER_IMAGE_ARTIFACT_DIRECTORY - -# Ensure at root of WORKSPACE -cd $WORKSPACE - -# For each docker image -for DOCKER_IMAGE in $(echo $DOCKER_IMAGES | tr "," "\n") -do - echo "----------------------------------------------------" - echo "Info: Archiving $DOCKER_IMAGE" - echo "----------------------------------------------------" - # Generate a name for the archive from its docker image name - # e.g. uds/sdc-customization/eo-cassandra-init becomes eo-cassandra-init - DOCKER_IMAGE_TAG=$(docker images $DOCKER_IMAGE | awk '{ print $2}' | sed -n '2p') - # Create docker tag for filename using uds build version e.g. 1.5-STAGING-latest - DOCKER_IMAGE_NAME=$(echo $DOCKER_IMAGE | awk -F/ '{print $NF}') - # Create docker tag for filename using timestamp e.g. 1.5.0-20200610T134812Z - #DOCKER_IMAGE_TAG=$(docker images $DOCKER_IMAGE | awk '{ print $2}' | sed -n '3p') - - # Create the archive.tar.gz - # Naming convention --.tar.gz - # Includes SHA commit ids of the projects for traceability of the artifacts - # e.g. eo-cassandra-init-1.7-STAGING-latest-6d3abef-d96bad4.tar.gz - docker save $DOCKER_IMAGE | gzip -c > $DOCKER_IMAGE_ARTIFACT_DIRECTORY/$DOCKER_IMAGE_NAME-$DOCKER_IMAGE_TAG-$COMMIT_IDS.tar.gz -done diff --git a/jjb/onap/uds/scripts/archive-repos.sh b/jjb/onap/uds/scripts/archive-repos.sh deleted file mode 100644 index b147e94d..00000000 --- a/jjb/onap/uds/scripts/archive-repos.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -# Make directory to hold source repository archive artifact -mkdir -p $REPO_ARCHIVE_ARTIFACT_DIRECTORY - -# Ensure at root of the $WORKSPACE -cd $WORKSPACE - -# Parse uds version number from pom.xml file for use within archive filename -# e.g. 1.7.0-SNAPSHOT -VERSION=$(grep $GREP_PARAMS $POM_LOCATION) - -# Compress each source repository into an archive -# Includes SHA commit ids of the projects for traceability of the artifacts -# e.g. uds-1.7.0-SNAPSHOT-6d3abef-d96bad4.tar.gz -echo "----------------------------------------------------" -echo "INFO: Archive $PROJECTS" -echo "----------------------------------------------------" -tar -zcvf $REPO_ARCHIVE_ARTIFACT_DIRECTORY/$ARCHIVENAME-$VERSION-$COMMIT_IDS.tar.gz $PROJECT_DIRECTORIES diff --git a/jjb/onap/uds/scripts/collect-artifacts.sh b/jjb/onap/uds/scripts/collect-artifacts.sh deleted file mode 100644 index 20bb3eed..00000000 --- a/jjb/onap/uds/scripts/collect-artifacts.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -# Make directory to hold file artifacts (.war .jar etc) -mkdir -p $ARTIFACT_DIRECTORY - -# Ensure at root of $WORKSPACE -cd $WORKSPACE - -# For each file artifact create a copy in ARTIFACT_DIRECTORY -# ARTIFACT_DIRECTORY's contents will be pushed to Artifactory -# Required because artifacts in target directories will be deleted during a mvn clean -# which is done before archiving the source repos in order limit file size -for ARTIFACT in $ARTIFACT_PATHS -do - # Check if file exists before copying - if [ ! -f "$ARTIFACT" ]; then - echo "$ARTIFACT does not exist." - exit 1 - fi - - echo "----------------------------------------------------" - echo "Info: Copy $ARTIFACT into $ARTIFACT_DIRECTORY" - echo "----------------------------------------------------" - cp $WORKSPACE/$ARTIFACT $ARTIFACT_DIRECTORY -done - -cd $ARTIFACT_DIRECTORY - -# Rename the artifacts to include SHA commit ids of the projects for traceability -# e.g. 6d3abef-d96bad4-catalog-be-1.6.1-SNAPSHOT.war -for ARTIFACT in * -do - echo "----------------------------------------------------" - echo "Info: Adding CommitIDs $COMMIT_IDS to $ARTIFACT filename" - echo "----------------------------------------------------" - mv "$ARTIFACT" "$COMMIT_IDS-$ARTIFACT" -done diff --git a/jjb/onap/uds/scripts/generate-build-metadata.sh b/jjb/onap/uds/scripts/generate-build-metadata.sh deleted file mode 100644 index fd9fb394..00000000 --- a/jjb/onap/uds/scripts/generate-build-metadata.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -# Turn PROJECTS and PROJECT_DIRECTORIES paramter strings into arrays -# Required in order to loop through them -PROJECTS=(`echo $PROJECTS | sed 's/,/\n/g'`) -PROJECT_DIRECTORIES=(`echo $PROJECT_DIRECTORIES | sed 's/,/\n/g'`) -# Find and store array lenth using one of the arrays -ARRAY_LENGTH=$(echo ${#PROJECTS[@]}) -# Take 1 of the array length for the loop -((ARRAY_LENGTH--)) - -# Iterate over project source repositories and fetch the SHA commit ids -declare -a COMMIT_IDS -for i in $(seq 0 $ARRAY_LENGTH) -do - echo "----------------------------------------------------" - echo "INFO: Fetching Build ID of ${PROJECTS[$i]}" - echo "----------------------------------------------------" - cd $WORKSPACE/${PROJECT_DIRECTORIES[$i]} - COMMIT_IDS[$i]=$(echo $(git rev-parse --short HEAD)) -done - -# Generate a build.properties file in order to share variables among jobs -# Includes SHA commit ids of the source repositories to include in artifact filenames for traceability -echo "-------------------------------------------------------------------------" -echo "INFO: Generating build metadata" -echo "-------------------------------------------------------------------------" -cat << EOF > "$WORKSPACE/build.properties" -BUILD_DATE=$(date '+%Y%m%d%H%M') -BUILT_BY=$BUILD_URL -COMMIT_IDS=$(echo ${COMMIT_IDS[@]} | tr " " -) -EOF - -echo "-------------------------------------------------------------------------" -echo "INFO: Creating build metadata file build.properties" -echo "-------------------------------------------------------------------------" -cat "$WORKSPACE/build.properties" -echo "-------------------------------------------------------------------------" diff --git a/jjb/onap/uds/scripts/maven-build.sh b/jjb/onap/uds/scripts/maven-build.sh deleted file mode 100644 index 761e4292..00000000 --- a/jjb/onap/uds/scripts/maven-build.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -cd $WORKSPACE - -echo "----------------------------------------------------" -echo "Info: Java version" -echo "----------------------------------------------------" -java -version - -echo "----------------------------------------------------" -echo "Info: Downloading Maven $MVN_VERSION from $MVN_URL" -echo "----------------------------------------------------" -wget -q $MVN_URL && unzip -qqn apache-maven-$MVN_VERSION-bin.zip - -echo "----------------------------------------------------" -echo "Info: Maven version" -echo "----------------------------------------------------" -$MVN -version - -echo "----------------------------------------------------" -echo "Info: Downloading ONAP Maven XML for build process" -echo "----------------------------------------------------" -git clone "https://git.onap.org/oparent" $WORKSPACE/oparent -cd $WORKSPACE/oparent -# Check if a commitid parameter is given to specify a version of -# oparent repository to checkout -if [[ -v MVN_SETTINGS_XML_VERSION ]]; then - git checkout $MVN_SETTINGS_XML_VERSION -fi -# Copy Onap maven settings.xml to Jenkins home directory -mkdir -p /home/jenkins/.m2/ -cp settings.xml /home/jenkins/.m2/settings.xml -cd $WORKSPACE - - -echo "----------------------------------------------------" -echo "Info: Ensuring Docker is running" -echo "----------------------------------------------------" -# If docker daemon isnt up attempt to start it -if ! docker info; -then - systemctl start docker -fi - -# Turn PROJECTS and PROJECT_DIRECTORIES paramter strings into arrays -# Required in order to loop through them -PROJECTS=(`echo $PROJECTS | sed 's/,/\n/g'`) -PROJECT_DIRECTORIES=(`echo $PROJECT_DIRECTORIES | sed 's/,/\n/g'`) - -# Find and store array lenth of one of the arrays -ARRAY_LENGTH=$(echo ${#PROJECTS[@]}) -# Take 1 of the array length for the loop -((ARRAY_LENGTH--)) - -# For each project source repository do a maven build -# e.g. maven clean install -DskipTests -Pdocker -for i in $(seq 0 $ARRAY_LENGTH) -do - echo "----------------------------------------------------" - echo "INFO: Maven Build for ${PROJECTS[$i]}" - echo "----------------------------------------------------" - $MVN -U clean install $MVN_PARAMS -f ${PROJECT_DIRECTORIES[$i]} -done diff --git a/jjb/onap/uds/scripts/maven-clean.sh b/jjb/onap/uds/scripts/maven-clean.sh deleted file mode 100644 index e82b6812..00000000 --- a/jjb/onap/uds/scripts/maven-clean.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -# Turn PROJECTS and PROJECT_DIRECTORIES paramter strings into arrays -PROJECTS=(`echo $PROJECTS | sed 's/,/\n/g'`) -PROJECT_DIRECTORIES=(`echo $PROJECT_DIRECTORIES | sed 's/,/\n/g'`) - -# Find and store array lenth of one of the arrays -ARRAY_LENGTH=$(echo ${#PROJECTS[@]}) -# Take 1 of the array length for the loop -((ARRAY_LENGTH--)) - -# Do a Maven clean for each project source repository -# Required to reduce filesize before archiving source repositories together -for i in $(seq 0 $ARRAY_LENGTH) -do - echo "----------------------------------------------------" - echo "INFO: Maven Clean for ${PROJECTS[$i]}" - echo "----------------------------------------------------" - $MVN clean -f $WORKSPACE/${PROJECT_DIRECTORIES[$i]} -done diff --git a/jjb/onap/uds/scripts/pull-repos.sh b/jjb/onap/uds/scripts/pull-repos.sh deleted file mode 100644 index 2ca8f612..00000000 --- a/jjb/onap/uds/scripts/pull-repos.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -# Turn PROJECTS, BRANCHES and PROJECT_DIRECTORIES paramter strings into arrays -# Required in order to loop through them -PROJECTS=(`echo $PROJECTS | sed 's/,/\n/g'`) -BRANCHES=(`echo $BRANCHES | sed 's/,/\n/g'`) -PROJECT_DIRECTORIES=(`echo $PROJECT_DIRECTORIES | sed 's/,/\n/g'`) -# if commitids/project versions are given turn string into an array -PROJECT_VERSIONS=(`echo $PROJECT_VERSIONS | sed 's/,/\n/g'`) || echo "No project versions/commit ids specificed, latest sources will be used" - -# Find and store array lenth of one of the arrays -ARRAY_LENGTH=$(echo ${#PROJECTS[@]}) -# Take 1 of the array length for the loop -((ARRAY_LENGTH--)) - -# Create project directories and clone source repositories into them -for i in $(seq 0 $ARRAY_LENGTH) -do - echo "----------------------------------------------------" - echo "Info: Creating project directory ${PROJECT_DIRECTORIES[$i]}" - echo "----------------------------------------------------" - mkdir -p $WORKSPACE/${PROJECT_DIRECTORIES[$i]} - - echo "----------------------------------------------------" - echo "Info: Cloning ${PROJECTS[$i]} branch ${BRANCHES[$i]} into ${PROJECT_DIRECTORIES[$i]}" - echo "----------------------------------------------------" - git clone --single-branch --branch ${BRANCHES[$i]} $GIT_BASE_HTTPS${PROJECTS[$i]} $WORKSPACE/${PROJECT_DIRECTORIES[$i]} - - if ((${#PROJECT_VERSIONS[@]})); then - echo "----------------------------------------------------" - echo "Info: Checking out ${PROJECTS[$i]} to commit ${PROJECT_VERSIONS[$i]}" - echo "----------------------------------------------------" - cd $WORKSPACE/${PROJECT_DIRECTORIES[$i]} - git checkout ${PROJECT_VERSIONS[$i]} - cd $WORKSPACE - else - cd $WORKSPACE - fi -done diff --git a/jjb/onap/uds/scripts/push-artifacts.sh b/jjb/onap/uds/scripts/push-artifacts.sh deleted file mode 100644 index df1b7466..00000000 --- a/jjb/onap/uds/scripts/push-artifacts.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -# Go to directory holding file artifacts (.war .jar etc) -cd $ARTIFACT_DIRECTORY - -# For each artifact in ARTIFACT_DIRECTORY get the cheksums and upload to Artifactory -for ARTIFACT in * -do - echo $ARTIFACT - SHA_CHECKSUM=$(sha1sum $ARTIFACT| cut -d ' ' -f 1) - SHA256_CHECKSUM=$(sha256sum $ARTIFACT | cut -d ' ' -f 1) - MD5_CHECKSUM=$(md5sum $ARTIFACT | cut -d ' ' -f 1) - - curl -H "X-JFrog-Art-Api:$NORDIX_ARM_TOKEN" \ - -H "X-Checksum-Sha1:$SHA_CHECKSUM" \ - -H "X-Checksum-Sha256:$SHA256_CHECKSUM" \ - -H "X-Checksum-MD5:$MD5_CHECKSUM" \ - -X PUT "$ARTIFACTORY_URL/$ARTIFACTORY_ARTIFACT_PATH/$ARTIFACT" \ - -T $ARTIFACT -done diff --git a/jjb/onap/uds/scripts/push-images.sh b/jjb/onap/uds/scripts/push-images.sh deleted file mode 100644 index ce74a7dd..00000000 --- a/jjb/onap/uds/scripts/push-images.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -# Go to directory holding docker image artifacts -cd $DOCKER_IMAGE_ARTIFACT_DIRECTORY - -# For each artifact in DOCKER_IMAGE_ARTIFACT_DIRECTORY get the cheksums and upload to Artifactory -for ARTIFACT in * -do - echo $ARTIFACT - SHA_CHECKSUM=$(sha1sum $ARTIFACT| cut -d ' ' -f 1) - SHA256_CHECKSUM=$(sha256sum $ARTIFACT | cut -d ' ' -f 1) - MD5_CHECKSUM=$(md5sum $ARTIFACT | cut -d ' ' -f 1) - - curl -H "X-JFrog-Art-Api:$NORDIX_ARM_TOKEN" \ - -H "X-Checksum-Sha1:$SHA_CHECKSUM" \ - -H "X-Checksum-Sha256:$SHA256_CHECKSUM" \ - -H "X-Checksum-MD5:$MD5_CHECKSUM" \ - -X PUT "$ARTIFACTORY_URL/$ARTIFACTORY_DOCKER_IMAGES_PATH/$ARTIFACT" \ - -T $ARTIFACT -done diff --git a/jjb/onap/uds/scripts/push-repos.sh b/jjb/onap/uds/scripts/push-repos.sh deleted file mode 100644 index 95cabf9f..00000000 --- a/jjb/onap/uds/scripts/push-repos.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 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========================================================= - -set -o errexit -set -o nounset -set -o pipefail - -# Go to directory holding repository archive artifacts -cd $REPO_ARCHIVE_ARTIFACT_DIRECTORY - -# For each artifact in REPO_ARCHIVE_ARTIFACT_DIRECTORY get the cheksums and upload to Artifactory -for ARTIFACT in * -do - echo $ARTIFACT - SHA_CHECKSUM=$(sha1sum $ARTIFACT| cut -d ' ' -f 1) - SHA256_CHECKSUM=$(sha256sum $ARTIFACT | cut -d ' ' -f 1) - MD5_CHECKSUM=$(md5sum $ARTIFACT | cut -d ' ' -f 1) - - curl -H "X-JFrog-Art-Api:$NORDIX_ARM_TOKEN" \ - -H "X-Checksum-Sha1:$SHA_CHECKSUM" \ - -H "X-Checksum-Sha256:$SHA256_CHECKSUM" \ - -H "X-Checksum-MD5:$MD5_CHECKSUM" \ - -X PUT "$ARTIFACTORY_URL/$ARTIFACTORY_REPO_ARCHIVE_PATH/$ARTIFACT" \ - -T $ARTIFACT -done diff --git a/jjb/onap/uds/uds-daily-build-package-promote.yaml b/jjb/onap/uds/uds-daily-build-package-promote.yaml deleted file mode 100644 index f4a8c9dc..00000000 --- a/jjb/onap/uds/uds-daily-build-package-promote.yaml +++ /dev/null @@ -1,262 +0,0 @@ -# ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. -# ================================================================================ -# 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========================================================= ---- -- project: - name: 'uds-daily-build-package-promote' - projects: 'onap/sdc local/onap/uds/sdc-customization' - project-name: - - uds - branches: 20.3 master - project_directories: sdc sdc-customization - project_versions: - mvn_params: '-DskipTests -Pdocker' - # mvn_params: '-DskipTests -Pdocker' # re-enable when unit tests pass - mvn_settings_xml_version: - mvn_version: '3.6.0' - docker_images: ' - uds/sdc-cassandra-init, - uds/sdc-backend-init, - uds/sdc-be-plugin/etsi-nfv-nsd-csar, - uds/sdc-be-plugin/vf-csar, - uds/sdc-customization/eo-sdc-backend-init, - uds/sdc-customization/eo-cassandra-init, - uds/sdc-backend, - uds/sdc-onboard-backend, - uds/sdc-frontend, - uds/sdc-cassandra, - uds/sdc-simulator - ' - docker_image_artifact_directory: $WORKSPACE/artifacts/images - artifactory_docker_images_path: onap/uds/images - artifact_paths: 'sdc/catalog-be/target/catalog-be.war' - artifactory_artifact_path: onap/uds - artifact_directory: $WORKSPACE/artifacts/artifacts - artifactory_repo_archive_path: onap/uds/releases - repo_archive_artifact_directory: $WORKSPACE/artifacts/repos - grep_parameters: -oP (?<=uds.version>)[^<]+ - archive_name: uds - pom_location: sdc/pom.xml - workspace: /home/jenkins/nordix/slave_root/workspace/ - node: onap-uds-build-ubuntu1804 - - jobs: - - '{project-name}-daily-build-package-promote' - - '{project-name}-build' - - '{project-name}-package-artifacts' - - '{project-name}-package-images' - - '{project-name}-package-repositories' - - '{project-name}-promote-artifacts' - - '{project-name}-promote-images' - - '{project-name}-promote-repositories' - - -- job-template: - name: '{project-name}-daily-build-package-promote' - description: 'Job for building, packing and pushing UDS artifacts including sources, docker images and other arifacts to Artifactory' - project-type: 'multijob' - workspace: '{workspace}' - node: '{node}' - properties: - - logrotate - - parameters: - - multi-project-parameters: - projects: '{projects}' - branches: '{branches}' - project_directories: '{project_directories}' - project_versions: '{project_versions}' - - git-parameters - - maven-parameters: - mvn_params: '{mvn_params}' - mvn_settings_xml_version: '{mvn_settings_xml_version}' - mvn_version: '{mvn_version}' - - artifact_parameters: - artifact_paths: '{artifact_paths}' - artifactory_artifact_path: '{artifactory_artifact_path}' - artifact_directory: '{artifact_directory}' - - artifactory-parameters - - docker-archive-parameters: - docker_images: '{docker_images}' - artifactory_docker_images_path: '{artifactory_docker_images_path}' - docker_image_artifact_directory: '{docker_image_artifact_directory}' - - repo-archive-parameters: - grep_parameters: '{grep_parameters}' - pom_location: '{pom_location}' - archive_name: '{archive_name}' - artifactory_repo_archive_path: '{artifactory_repo_archive_path}' - repo_archive_artifact_directory: '{repo_archive_artifact_directory}' - - builders: - - 'pull-source-repositories' - - 'generate-build-metadata' - - multijob: - name: Build - condition: SUCCESSFUL - projects: - - name: '{project-name}-build' - current-parameters: true - node-parameters: true - abort-all-job: false - kill-phase-on: FAILURE - property-file: $WORKSPACE/build.properties - - multijob: - name: Package - condition: SUCCESSFUL - execution-type: SEQUENTIALLY - projects: - - name: '{project-name}-package-artifacts' - current-parameters: true - node-parameters: true - abort-all-job: false - kill-phase-on: FAILURE - property-file: $WORKSPACE/build.properties - - name: '{project-name}-package-images' - current-parameters: true - node-parameters: true - abort-all-job: false - kill-phase-on: FAILURE - property-file: $WORKSPACE/build.properties - - name: '{project-name}-package-repositories' - current-parameters: true - node-parameters: true - abort-all-job: false - kill-phase-on: FAILURE - property-file: $WORKSPACE/build.properties - - multijob: - name: Promote - condition: SUCCESSFUL - execution-type: PARALLEL - projects: - - name: '{project-name}-promote-artifacts' - current-parameters: true - node-parameters: true - abort-all-job: false - kill-phase-on: FAILURE - property-file: $WORKSPACE/build.properties - - name: '{project-name}-promote-images' - current-parameters: true - node-parameters: true - abort-all-job: false - kill-phase-on: FAILURE - property-file: $WORKSPACE/build.properties - - name: '{project-name}-promote-repositories' - current-parameters: true - node-parameters: true - abort-all-job: false - kill-phase-on: FAILURE - property-file: $WORKSPACE/build.properties - triggers: - - timed: "@midnight" - - gerrit: - server-name: 'Nordix Gerrit' - trigger-on: - - change-merged-event - - comment-added-contains-event: - comment-contains-value: 'remerge' - projects: - - project-compare-type: 'PLAIN' - project-pattern: 'onap/sdc' - branches: - - branch-compare-type: 'PLAIN' - branch-pattern: '20.2' - - project-compare-type: 'PLAIN' - project-pattern: 'local/onap/uds/sdc-customization' - branches: - - branch-compare-type: 'PLAIN' - branch-pattern: 'master' - - wrappers: - - openstack: - single-use: True - - -- job-template: - name: '{project-name}-build' - description: 'Job for building out uds repositories' - workspace: '{workspace}' - node: '{node}' - - builders: - - 'maven-build-repositories' - - -- job-template: - name: '{project-name}-package-artifacts' - description: 'Job for archiving uds artifacts (.war, .jar files etc.)' - workspace: '{workspace}' - node: '{node}' - - builders: - - 'collect-file-artifacts' - - -- job-template: - name: '{project-name}-package-images' - description: 'Job for archiving uds docker images' - workspace: '{workspace}' - node: '{node}' - - builders: - - 'package-docker-images' - - -- job-template: - name: '{project-name}-package-repositories' - description: 'Job for archiving uds source repos (sdc, sdc-customization)' - workspace: '{workspace}' - node: '{node}' - - builders: - - 'maven-clean-repositories' - - 'package-source-repositories' - - -- job-template: - name: '{project-name}-promote-artifacts' - description: 'Job for pushing uds file artifacts (.war, .jar files etc.) to Artifactory' - workspace: '{workspace}' - node: '{node}' - - builders: - - 'promote-file-artifacts-to-artifactory' - wrappers: - - 'artifactory-credentials' - - -- job-template: - name: '{project-name}-promote-images' - description: 'Job for pushing uds docker images to Artifactory' - workspace: '{workspace}' - node: '{node}' - - builders: - - 'promote-docker-images-to-artifactory' - wrappers: - - 'artifactory-credentials' - - -- job-template: - name: '{project-name}-promote-repositories' - description: 'Job for pushing uds source repositories (sdc, sdc-customization) to Artifactory' - workspace: '{workspace}' - node: '{node}' - - builders: - - 'promote-source-repositories-to-artifactory' - wrappers: - - 'artifactory-credentials' diff --git a/jjb/onap/uds/uds-macros.yaml b/jjb/onap/uds/uds-macros.yaml deleted file mode 100644 index 0692817d..00000000 --- a/jjb/onap/uds/uds-macros.yaml +++ /dev/null @@ -1,220 +0,0 @@ -# ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. -# ================================================================================ -# 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========================================================= - -#------------------------------------------------------------------------------- -# Macros are used to avoid hitting parameter expansion of curly brackets and -# the need to using include-raw-escape -#------------------------------------------------------------------------------- - ---- -# Parameters used for setting multiple Gerrit Projects on Nordix -# Required for cases where source repositories depend on each other to build -# e.g. sdc-customization depends on sdc repo -- parameter: - name: multi-project-parameters - parameters: - - string: - name: PROJECTS - default: '{projects}' - description: JJB configured PROJECTS parameter to identify Nordix Gerrit projects (e.g. onap/sdc local/onap/uds/sdc-customization) - - string: - name: BRANCHES - default: '{branches}' - description: "JJB configured BRANCHES parameter (e.g. 20.1 master)" - - string: - name: PROJECT_DIRECTORIES - default: '{project_directories}' - description: Directory names to place PROJECTS (e.g. sdc sdc-customization) - - string: - name: PROJECT_VERSIONS - default: '{project_versions}' - description: Commit ids of PROJECTS source to checkout e.g. 6d3ab d96ba Allows for building from specific versions of a source or can also be left blank to pull latest source. - -- parameter: - name: git-parameters - parameters: - - string: - name: GIT_BASE_HTTPS - default: https://gerrit.nordix.org/ - description: Base HTTPS URL of repository to clone from - -- parameter: - name: maven-parameters - parameters: - - string: - name: MVN_VERSION - default: '{mvn_version}' - description: Maven version to build with - - string: - name: MVN_URL - default: https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/$MVN_VERSION/apache-maven-$MVN_VERSION-bin.zip - description: Download URL for Maven - - string: - name: MVN - default: $WORKSPACE/apache-maven-$MVN_VERSION/bin/mvn - description: Path to mvn executable - - string: - name: MVN_PARAMS - default: '{mvn_params}' - description: Maven build parameters - - string: - name: MVN_SETTINGS_XML_VERSION - default: '{mvn_settings_xml_version}' - description: Commit ID of ONAP Oparent repository (https://git.onap.org/oparent/) to pull. Used for Maven settings file. Can be left blank to pull the latest version. - -- parameter: - name: artifactory-parameters - parameters: - - string: - name: ARTIFACTORY_URL - default: "https://artifactory.nordix.org/artifactory" - description: Artifactory URL to push to - -# Parameters for source repository artifacts -- parameter: - name: repo-archive-parameters - parameters: - - string: - name: POM_LOCATION - default: '{pom_location}' - description: Path to repository pom.xml parsed for version number used within archive filenames - - string: - name: GREP_PARAMS - default: '{grep_parameters}' - description: Parameters for grep command used for parsing pom file for version number used within archive filenames - - string: - name: ARCHIVENAME - default: '{archive_name}' - description: Name to be given to archive holding the repositories pushed to Artifactory - - string: - name: ARTIFACTORY_REPO_ARCHIVE_PATH - default: '{artifactory_repo_archive_path}' - description: Artifactory repository and path to push repository archive to - - string: - name: REPO_ARCHIVE_ARTIFACT_DIRECTORY - default: '{repo_archive_artifact_directory}' - description: Workspace directory to hold repository artifacts - - -# Parameters regarding docker image artifacts -- parameter: - name: docker-archive-parameters - parameters: - - text: - name: DOCKER_IMAGES - default: '{docker_images}' - description: Docker image names to archive and push to Artifactory - - string: - name: ARTIFACTORY_DOCKER_IMAGES_PATH - default: '{artifactory_docker_images_path}' - description: Artifactory repository and path to push docker images to - - string: - name: DOCKER_IMAGE_ARTIFACT_DIRECTORY - default: '{docker_image_artifact_directory}' - description: Workspace directory to hold docker image artifacts - -# Parameters regarding file artifacts (.war, .jar files etc) -- parameter: - name: artifact_parameters - parameters: - - text: - name: ARTIFACT_PATHS - default: '{artifact_paths}' - description: Artifact file paths that should be pushed to Artifactory, can contain wildcards e.g. PROJECTDIRECTORY/some/path/catalog-be-*.war - - string: - name: ARTIFACTORY_ARTIFACT_PATH - default: '{artifactory_artifact_path}' - description: Artifactory repository and path to push artifacts to e.g. .war .jar files - - string: - name: ARTIFACT_DIRECTORY - default: '{artifact_directory}' - description: Workspace directory to hold artifacts - - -# Builders for maven builds -- builder: - name: 'generate-build-metadata' - builders: - - shell: - !include-raw: ./scripts/generate-build-metadata.sh - -- builder: - name: 'pull-source-repositories' - builders: - - shell: - !include-raw: ./scripts/pull-repos.sh - -- builder: - name: 'maven-build-repositories' - builders: - - shell: - !include-raw: ./scripts/maven-build.sh - -- builder: - name: 'maven-clean-repositories' - builders: - - shell: - !include-raw: ./scripts/maven-clean.sh - -# Builders for packaging artifacts (.war .jar, docker images and source repositories) -- builder: - name: 'collect-file-artifacts' - builders: - - shell: - !include-raw: ./scripts/collect-artifacts.sh - -- builder: - name: 'package-docker-images' - builders: - - shell: - !include-raw: ./scripts/archive-images.sh - -- builder: - name: 'package-source-repositories' - builders: - - shell: - !include-raw: ./scripts/archive-repos.sh - -# Builders for promoting/pushing artifacts (.war, .jar, docker images and source repositories) to Artifactory -- builder: - name: 'promote-file-artifacts-to-artifactory' - builders: - - shell: - !include-raw: ./scripts/push-artifacts.sh - -- builder: - name: 'promote-docker-images-to-artifactory' - builders: - - shell: - !include-raw: ./scripts/push-images.sh - -- builder: - name: 'promote-source-repositories-to-artifactory' - builders: - - shell: - !include-raw: ./scripts/push-repos.sh - -# Wrapper for Artifactory API Key -- wrapper: - name: 'artifactory-credentials' - wrappers: - - credentials-binding: - - username-password-separated: - credential-id: 'nordix-cicd-arm-credentials' - username: NORDIX_ARM_USERNAME - password: NORDIX_ARM_TOKEN -- 2.25.1