osmith submitted this change.

View Change

Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved
contrib/jenkins.sh: skip upload if nothing new

The contrib/jenkins.sh script gets triggered daily. Do not upload new
files unless a new commit was added (then the filename changes).
Otherwise the binary and timestamp change on the server each day, which
is confusing and potentially makes catching regressions harder.

I've also considered disabling the daily trigger for this repository,
but I think it's better to keep it so we notice without much delay if
changes in libosmocore or the toolchain cause a build failure.

Change-Id: I3f70d6149b29ec2ff7f185dfae8bc8d4a1953dc2
---
M contrib/jenkins.sh
1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 7877dcf..961acf1 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -71,14 +71,22 @@
[ftp.osmocom.org]:48 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK8iivY70EiR5NiGChV39gRLjNpC8lvu1ZdHtdMw2zuX
EOF
SSH_COMMAND="ssh -o 'UserKnownHostsFile=/build/known_hosts' -p 48"
- rsync --archive --copy-links --verbose --compress --delete --rsh "$SSH_COMMAND" \
- $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.{bin,elf} \
- binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/latest/
- rsync --archive --verbose --compress --rsh "$SSH_COMMAND" \
- --exclude $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.bin \
- --exclude $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.elf \
- $TOPDIR/sysmoOCTSIM/gcc/*-*.{bin,elf} \
- binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/all/
+ LATEST_BIN="$(cd "$TOPDIR"/sysmoOCTSIM/gcc/; ls -1 sysmoOCTSIM-*-*.bin)"
+
+ echo "LATEST_BIN: $LATEST_BIN"
+
+ if rsync --rsh "$SSH_COMMAND" binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/all/ | grep -q "$LATEST_BIN"; then
+ echo "Skipping upload, $LATEST_BIN has already been uploaded."
+ else
+ rsync --archive --copy-links --verbose --compress --delete --rsh "$SSH_COMMAND" \
+ $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.{bin,elf} \
+ binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/latest/
+ rsync --archive --verbose --compress --rsh "$SSH_COMMAND" \
+ --exclude $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.bin \
+ --exclude $TOPDIR/sysmoOCTSIM/gcc/sysmoOCTSIM.elf \
+ $TOPDIR/sysmoOCTSIM/gcc/*-*.{bin,elf} \
+ binaries@ftp.osmocom.org:web-files/osmo-ccid-firmware/all/
+ fi
fi

echo

To view, visit change 28186. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: I3f70d6149b29ec2ff7f185dfae8bc8d4a1953dc2
Gerrit-Change-Number: 28186
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged