osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-rp2040-firmware/+/40228?usp=email )
Change subject: contrib/jenkins: publish binaries
......................................................................
contrib/jenkins: publish binaries
Publish binaries to:
https://ftp.osmocom.org/binaries/osmo-rp2040-firmware/
Related: OS#6784
Change-Id: Ic22d693bfebc33278033514fa5900866454e499f
---
M contrib/jenkins.sh
1 file changed, 56 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-rp2040-firmware refs/changes/28/40228/1
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 7f72e1b..7049ea6 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -3,6 +3,10 @@
iso7816_cardem
osmo-gtm900
"
+PUBLISH_EXT="
+ elf
+ uf2
+"
rm -rf build
mkdir build
@@ -16,3 +20,55 @@
make -j$(nproc) "$i"
done
+
+if [ "$PUBLISH" = 1 ]; then
+ echo
+ echo "=== publishing binaries ==="
+ echo
+
+ VERSION="$(git describe HEAD)"
+ SSH_COMMAND="ssh -o 'UserKnownHostsFile=/osmo-ci/contrib/known_hosts' -p
48"
+ UPLOAD_PATH="binaries@ftp.osmocom.org:web-files/osmo-rp2040-firmware"
+ EXISTING_BINARIES="$(rsync \
+ --rsh "$SSH_COMMAND" \
+ "$UPLOAD_PATH"/all/)"
+
+ if [ -z "$VERSION" ]; then
+ echo "ERROR: failed to get version from 'git describe HEAD'"
+ exit 1
+ fi
+
+ for target in $TARGETS; do
+ for ext in $PUBLISH_EXT; do
+ BIN_PATH="$(find -name "$target.$ext")"
+ if [ -z "$BIN_PATH" ]; then
+ echo "ERROR: failed to find $target.$ext"
+ exit 1
+ fi
+
+ BIN_LATEST="$target-$VERSION.$ext"
+ if echo "$EXISTING_BINARIES" | grep -q "$BIN_LATEST"; then
+ echo "$BIN_LATEST: exists on server, skipping"
+ continue
+ fi
+
+ echo "$BIN_LATEST: uploading $BIN_PATH"
+
+ rsync \
+ --rsh "$SSH_COMMAND" \
+ -a \
+ "$BIN_PATH" \
+ "$UPLOAD_PATH"/latest/"$target.$ext"
+
+ rsync \
+ --rsh "$SSH_COMMAND" \
+ -a \
+ "$BIN_PATH" \
+ "$UPLOAD_PATH"/all/"$BIN_LATEST"
+ done
+ done
+fi
+
+echo
+echo "=== success ==="
+echo
--
To view, visit
https://gerrit.osmocom.org/c/osmo-rp2040-firmware/+/40228?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-rp2040-firmware
Gerrit-Branch: master
Gerrit-Change-Id: Ic22d693bfebc33278033514fa5900866454e499f
Gerrit-Change-Number: 40228
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>