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