Fix for UDS build job 29/5629/2
authormatthew-mcneilly <matthew.mcneilly@est.tech>
Tue, 4 Aug 2020 10:03:40 +0000 (11:03 +0100)
committermatthew-mcneilly <matthew.mcneilly@est.tech>
Tue, 4 Aug 2020 10:07:11 +0000 (11:07 +0100)
Fix for archiving of both source repos.
Specified mvn_version parameter under project.
Follow on change for
https://gerrit.nordix.org/#/c/infra/cicd/+/5154/

Signed-off-by: matthew-mcneilly <matthew.mcneilly@est.tech>
Change-Id: If7af42b97fb293e5450e7941397a47c2aacbd2ef

jjb/onap/uds/scripts/archive-repos.sh
jjb/onap/uds/uds-daily-build-package-promote.yaml
jjb/onap/uds/uds-macros.yaml

index 54527f9ff86465d8500fc2e1e3199123913a8ae3..b147e94d587d48dff45f169629467b81e931199a 100644 (file)
@@ -24,16 +24,6 @@ set -o pipefail
 # Make directory to hold source repository archive artifact
 mkdir -p $REPO_ARCHIVE_ARTIFACT_DIRECTORY
 
-# 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--))
-
 # Ensure at root of the $WORKSPACE
 cd $WORKSPACE
 
@@ -44,10 +34,7 @@ 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
-for i in $(seq 0 $ARRAY_LENGTH)
-do
-  echo "----------------------------------------------------"
-  echo "INFO: Archive ${PROJECTS[$i]}"
-  echo "----------------------------------------------------"
-  tar -zcvf $REPO_ARCHIVE_ARTIFACT_DIRECTORY/$ARCHIVENAME-$VERSION-$COMMIT_IDS.tar.gz ${PROJECT_DIRECTORIES[$i]}
-done
+echo "----------------------------------------------------"
+echo "INFO: Archive $PROJECTS"
+echo "----------------------------------------------------"
+tar -zcvf $REPO_ARCHIVE_ARTIFACT_DIRECTORY/$ARCHIVENAME-$VERSION-$COMMIT_IDS.tar.gz $PROJECT_DIRECTORIES
index abb60204177b68345114f8484f72141c736cb042..dfbd91bd9d6a1aac7842dd5378bef3f38bf62917 100644 (file)
 ---
 - project:
     name: 'uds-daily-build-package-promote'
-    projects: 'onap/sdc, local/onap/uds/sdc-customization'
+    projects: 'onap/sdc local/onap/uds/sdc-customization'
     project-name:
       - uds
-    branches: 20.2, master
-    project_directories: sdc, sdc-customization
+    branches: 20.2 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,
@@ -80,6 +81,7 @@
       - 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}'
index 186f6911340db2fb22d43f356d2d50bfe20dd119..0692817dd75bee6f9d0a1b090aa22160ae643314 100644 (file)
       - string:
           name: PROJECTS
           default: '{projects}'
-          description: JJB configured PROJECTS parameter to identify Nordix Gerrit 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)"
+          description: "JJB configured BRANCHES parameter (e.g. 20.1 master)"
       - string:
           name: PROJECT_DIRECTORIES
           default: '{project_directories}'
-          description: Directory names to place PROJECTS
+          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.
+          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
@@ -58,7 +58,7 @@
     parameters:
       - string:
           name: MVN_VERSION
-          default: 3.6.0
+          default: '{mvn_version}'
           description: Maven version to build with
       - string:
           name: MVN_URL