You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Application/drone/deliver.sh

45 lines
948 B

#!/usr/bin/bash
TYPE="$1"
case "$DRONE_BRANCH" in
"production")
OPTIONS="--release"
;;
"")
echo '$DRONE_BRANCH not set' >&2
exit 1
;;
*)
OPTIONS="--debug"
;;
esac
APP_DIR="/home/maxime/server/TBasket/application"
case "$TYPE" in
"android")
OPTIONS="$OPTIONS -- --packageType=apk"
OUT_DIR="platforms/android/app/build/outputs/apk"
;;
"browser")
OUT_DIR="platforms/browser/www"
;;
"electron")
OUT_DIR="platforms/electron/build"
;;
*)
echo "unrecognized platform $TYPE." >&2
;;
esac
SERV_DIR="$APP_DIR/$TYPE"
cordova build "$TYPE" $OPTIONS
echo "delivering outputs on server"
#prepare ssh / scp commands
curl https://codefirst.iut.uca.fr/git/Tactique-basket/Backend/raw/branch/dev/drone/prepare-deliver.sh > /tmp/prepare-deliver.sh
source /tmp/prepare-deliver.sh
echo "making delivery onto '$USER@$IP:$DIR'"
scp -o "StrictHostKeyChecking no" "$OUT_DIR" "$USER@$IP:$SERV_DIR"