Blame build-papagayong-linux.sh

cd7cfc
#!/bin/bash
cd7cfc
cd7cfc
set -e
cd7cfc
cd7cfc
BASE_DIR=$(cd `dirname "$0"`; pwd)
cd7cfc
DATA_DIR="$BASE_DIR/docker-builder-data"
cd7cfc
BUILD_DIR=$DATA_DIR/build
cd7cfc
PUBLISH_DIR=$BASE_DIR/publish
cd7cfc
cd7cfc
CONFIG_FILE="$BASE_DIR/config.sh"
cd7cfc
PACKET_BUILD_DIR="$BUILD_DIR/packet"
cd7cfc
SCRIPT_BUILD_DIR="$BUILD_DIR/script"
cd7cfc
if [ -f $CONFIG_FILE ]; then
cd7cfc
	source $CONFIG_FILE
cd7cfc
fi
cd7cfc
cd7cfc
run() {
cd7cfc
	local SCRIPT=$1
cd7cfc
	local PLATFORM=$2
cd7cfc
	local PLATFORM_SUFFIX=$3
cd7cfc
cd7cfc
	echo ""
cd7cfc
	echo "Update papagayong for $PLATFORM_SUFFIX"
cd7cfc
	echo ""
cd7cfc
	
cd7cfc
	$SCRIPT update papagayong-master
cd7cfc
	$SCRIPT clean_before_do install_release papagayong-appimage
cd7cfc
	local DIR="$PACKET_BUILD_DIR/$PLATFORM/papagayong-appimage/install_release"
cd7cfc
	local VERSION_FILE="$PACKET_BUILD_DIR/$PLATFORM/papagayong-appimage/envdeps_release/version-papagayong-master"
cd7cfc
	local VERSION=`cat "$VERSION_FILE" | cut -d'-' -f 1`
cd7cfc
	local COMMIT=`cat "$VERSION_FILE" | cut -d'-' -f 2-`
cd7cfc
	COMMIT="${COMMIT:0:5}"
cd7cfc
	local DATE=`date -u +%Y.%m.%d`
cd7cfc
	if [ -z "$COMMIT" ]; then
cd7cfc
		echo "Cannot find version, pheraps appimage not ready. Cancel."
cd7cfc
		return 1
cd7cfc
	fi
cd7cfc
	if ! ls $PUBLISH_DIR/PapagayoNG-$VERSION-*-$COMMIT-$PLATFORM_SUFFIX.appimage 1> /dev/null 2>&1; then
cd7cfc
		echo "Publish new version $VERSION-$COMMIT-$PLATFORM_SUFFIX"
cd7cfc
		rm -f $PUBLISH_DIR/PapagayoNG-*-$PLATFORM_SUFFIX.appimage
cd7cfc
		cp $DIR/papagayong.appimage $PUBLISH_DIR/PapagayoNG-$VERSION-$DATE-$COMMIT-$PLATFORM_SUFFIX.appimage
cd7cfc
		if [ -f "$PUBLISH_DIR/publish-papagayong.sh" ]; then
cd7cfc
			"$PUBLISH_DIR/publish-papagayong.sh" "$PUBLISH_DIR/PapagayoNG-$VERSION-$DATE-$COMMIT-$PLATFORM_SUFFIX.appimage"
cd7cfc
		fi
cd7cfc
	else
cd7cfc
		echo "Version $VERSION-$COMMIT-$PLATFORM_SUFFIX already published"
cd7cfc
	fi
cd7cfc
}
cd7cfc
cd7cfc
run "$BASE_DIR/docker/debian-7-64bit/run.sh" "linux-x64" "64bits"
cd7cfc
run "$BASE_DIR/docker/debian-7-32bit/run.sh" "linux-i386" "32bits"