annotate deploy/clean-build-and-package @ 2390:1f392d58ee88

Towards single-script packaging
author Chris Cannam
date Mon, 21 Oct 2019 10:55:15 +0100
parents
children ab2d0fe8f0b7
rev   line source
Chris@2390 1 #!/bin/bash
Chris@2390 2
Chris@2390 3 set -eu
Chris@2390 4
Chris@2390 5 current=$(hg id | awk '{ print $1; }')
Chris@2390 6
Chris@2390 7 case "$current" in
Chris@2390 8 *+) echo "ERROR: Current working copy has been modified - not proceeding"; exit 2;;
Chris@2390 9 *);;
Chris@2390 10 esac
Chris@2390 11
Chris@2390 12 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
Chris@2390 13
Chris@2390 14 echo -n "Proceed to rebuild and package version $version [Yn] ? "
Chris@2390 15 read yn
Chris@2390 16
Chris@2390 17 if [ -z "$yn" ]; then
Chris@2390 18 yn=y
Chris@2390 19 elif [ "$yn" = "Y" ]; then
Chris@2390 20 yn=y
Chris@2390 21 fi
Chris@2390 22
Chris@2390 23 if [ "$yn" != "y" ]; then
Chris@2390 24 exit 3
Chris@2390 25 fi
Chris@2390 26
Chris@2390 27 echo "Proceeding"
Chris@2390 28
Chris@2390 29 mkdir -p packages
Chris@2390 30
Chris@2390 31 ./deploy/linux/build-and-test-appimage.sh
Chris@2390 32
Chris@2390 33 squashedversion=$(echo "$version" | sed 's/_-//g')
Chris@2390 34
Chris@2390 35 mv deploy/linux/docker/output/SonicVisualiser-"$current"-x86_64.AppImage \
Chris@2390 36 packages/SonicVisualiser-"$squashedversion"-x86_64.AppImage
Chris@2390 37
Chris@2390 38 ./deploy/linux/build-and-test-deb.sh
Chris@2390 39
Chris@2390 40 mv deploy/linux/docker/output/sonic-visualiser_"$version"_amd64.deb \
Chris@2390 41 packages/
Chris@2390 42
Chris@2390 43 echo "Done"
Chris@2390 44