contrib/jenkins: skip upload if nothing new

Add the same behavior as in osmo-ccid-firmware
I3f70d6149b29ec2ff7f185dfae8bc8d4a1953dc2.
pull/2/head
Oliver Smith 7 months ago
parent 1067d320fa
commit c7e08bbd11
  1. 17
      contrib/jenkins.sh

@ -42,7 +42,20 @@ SSH_COMMAND="ssh -o 'UserKnownHostsFile=/tmp/known_hosts' -p 48"
for proj in $PROJECTS; do
echo "=============== $proj UPLOAD =============="
cd "$TOPDIR/projects/$proj"
rsync --archive --copy-links --verbose --compress --delete --rsh "$SSH_COMMAND" ${proj}.{bin,elf,srec} binaries@ftp.osmocom.org:web-files/osmo-opencm3-projects/latest/
rsync --archive --verbose --compress --rsh "$SSH_COMMAND" ${proj}-*.{bin,elf,srec} binaries@ftp.osmocom.org:web-files/osmo-opencm3-projects/all/
LATEST_BIN="$(ls -1 -t "$proj"-*.bin | head -n1)"
echo "LATEST_BIN: $LATEST_BIN"
if rsync --rsh "$SSH_COMMAND" binaries@ftp.osmocom.org:web-files/osmo-opencm3-projects/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" \
${proj}.{bin,elf,srec} \
binaries@ftp.osmocom.org:web-files/osmo-opencm3-projects/latest/
rsync --archive --verbose --compress --rsh "$SSH_COMMAND" \
${proj}-*.{bin,elf,srec} \
binaries@ftp.osmocom.org:web-files/osmo-opencm3-projects/all/
fi
echo "=============== $proj UPLOAD DONE =============="
done

Loading…
Cancel
Save