Fix for the collecting of artifacts 73/5573/1
authormatthew-mcneilly <matthew.mcneilly@est.tech>
Wed, 29 Jul 2020 15:36:04 +0000 (16:36 +0100)
committermatthew-mcneilly <matthew.mcneilly@est.tech>
Wed, 29 Jul 2020 15:36:08 +0000 (16:36 +0100)
Follow on change for
https://gerrit.nordix.org/#/c/infra/cicd/+/5154/

Switching from soft links to copying artifacts
Artifacts in target directories are removed during
mvn clean process when archving source repos resulting
in build failing because they arent found when promoting

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

jjb/onap/uds/scripts/collect-artifacts.sh

index 3cc778e9645626f9337549b22fe69b7b609582be..20bb3eed012284a6b10a32a00cdcb49c0d46f412 100644 (file)
@@ -27,12 +27,13 @@ mkdir -p $ARTIFACT_DIRECTORY
 # Ensure at root of $WORKSPACE
 cd $WORKSPACE
 
-# For each file artifact create a reference in ARTIFACT_DIRECTORY
-# uses softlinks in order to save space and time
-# ARTIFACT_DIRECTORY contents will be pushed to Artifactory
+# 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 creating a softlink
+  # Check if file exists before copying
   if [ ! -f "$ARTIFACT" ]; then
     echo "$ARTIFACT does not exist."
     exit 1
@@ -41,7 +42,7 @@ do
   echo "----------------------------------------------------"
   echo "Info: Copy $ARTIFACT into $ARTIFACT_DIRECTORY"
   echo "----------------------------------------------------"
-  ln -sf $WORKSPACE/$ARTIFACT $ARTIFACT_DIRECTORY
+  cp $WORKSPACE/$ARTIFACT $ARTIFACT_DIRECTORY
 done
 
 cd $ARTIFACT_DIRECTORY