diff options
author | Oliver Smith <osmith@sysmocom.de> | 2022-11-30 16:26:38 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2022-11-30 16:52:13 +0100 |
commit | 757396a61b6ac06098d3a28101e2e42366453dbe (patch) | |
tree | 52ee4a2b969e752a2908a49e79077caa3c182b36 | |
parent | c4f160e2c2b8a76c18a8fa6ee161245f49b5f01e (diff) |
release-tarball-build-dist: check exists on server
Previously this job relied on always running on the same jenkins node,
and having the previously built release tarballs in a workspace
directory that does not get removed. It would only skip building a
release tarball if the file already exists locally.
As part of OS#5793 this job needs to be moved away from that jenkins
node. When trying to run the job on a different node, it will build all
release tarballs again which takes unnecessarsily long and actually
fails on libosmocore-0.9.4 due to a missing python2.
This probably happens because the job was refactored at some point and I
didn't realize that the python2 dep is now missing as the previous
tarballs existed.
In general it doesn't make much sense to build previous release tarballs
again and to always keep the legacy environments around for that. Change
the code to check if a tarball exists on the server, and skip building
the tarball in that case.
Related: OS#5793
Related: https://jenkins.osmocom.org/jenkins/view/All%20no%20Gerrit/job/Osmocom-release-tarballs/1281/console
Change-Id: I4b8c149c9cdbe7c613eea5d9be15794de5e5ddce
-rw-r--r-- | release-tarball-build-dist/osmocom-release-tarballs.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/release-tarball-build-dist/osmocom-release-tarballs.sh b/release-tarball-build-dist/osmocom-release-tarballs.sh index 04b8350..8f3d3ac 100644 --- a/release-tarball-build-dist/osmocom-release-tarballs.sh +++ b/release-tarball-build-dist/osmocom-release-tarballs.sh @@ -191,6 +191,15 @@ remove_temp_dir() { fi } +get_existing_tarballs() { + if ! $SSH_COMMAND releases@ftp.osmocom.org -- \ + find web-files -name '*.tar.bz2' \ + > "$TEMP"/existing_tarballs; then + echo "ERROR: getting existing tarballs from remote failed!" + exit 1 + fi +} + # Clone an Osmocom repository to $TEMP/repos/$repo, clean it, checkout a tag. # $1: Osmocom repository (may end in subdir, e.g. simtrace2/host) # $2: tag (optional, default: master) @@ -318,13 +327,15 @@ create_move_tarball() { upload() { cd _release_tarballs - rsync -avz --delete -e "$SSH_COMMAND" . releases@ftp.osmocom.org:web-files/ + rsync -avz -e "$SSH_COMMAND" . releases@ftp.osmocom.org:web-files/ } remove_temp_dir mkdir -p "$TEMP/repos" echo "Temp dir: $TEMP" +get_existing_tarballs + for repo in $OSMO_RELEASE_REPOS; do echo "$repo" tags="$(osmo_git_last_commits_tags "$repo" "all" | cut -d / -f 3)" @@ -342,7 +353,10 @@ for repo in $OSMO_RELEASE_REPOS; do echo " $tarball (ignored)" continue elif [ -e "$OUTPUT/$repo/$tarball" ]; then - echo " $tarball (exists)" + echo " $tarball (exists locally)" + continue + elif grep -q "^web-files/$repo/$tarball$" "$TEMP"/existing_tarballs; then + echo " $tarball (exists on server)" continue fi |