ci: archive artefacts even on build failure
The `tf-a-builder` job currently neglects to archive build artefacts if
the job fails, as the artefact directory is not copied to the job
workspace until *after* the script has exited with a failure.
Rather than copying the artefacts directory to the workspace, this
change instead symlinks the artefacts directory to where Jenkins expects
it early on, such that they are always available to Jenkins regardless
of where the build fails.
Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: I3431c086521bd7870bcc251bb7f33f443897714b
diff --git a/tf-a-builder.yaml b/tf-a-builder.yaml
index 823d09c..7837209 100644
--- a/tf-a-builder.yaml
+++ b/tf-a-builder.yaml
@@ -157,6 +157,7 @@
artifacts: artefacts/**, lava-binmode.txt
latest-only: false
allow-empty: true
+ follow-symlinks: true
- conditional-publisher:
- condition-kind: file-exists
on-evaluation-failure: dont-run
diff --git a/tf-a-builder/builders.sh b/tf-a-builder/builders.sh
index a591bf8..8306ef4 100755
--- a/tf-a-builder/builders.sh
+++ b/tf-a-builder/builders.sh
@@ -170,6 +170,7 @@
fi
mkdir -p "${workspace}"
+ln -sfn "${workspace}/artefacts" "${WORKSPACE}/artefacts"
bash $bash_opts "$ci_root/script/build_package.sh"
# compress rootfs.bin file
@@ -178,5 +179,3 @@
d=$(dirname $r); b=$(basename $r); cd "$d" && gzip "$b"
done
done
-
-cp -a $(find ${workspace} -type d -name artefacts) ${WORKSPACE}/