adding drone supports
continuous-integration/drone Build encountered an error
Details
continuous-integration/drone Build encountered an error
Details
parent
027d808706
commit
238acf40fd
@ -0,0 +1,25 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Deliver
|
||||
|
||||
environment:
|
||||
SSH_PRIVATE_KEY:
|
||||
from_secret: SSH_PRIVATE
|
||||
SSH_PUBLIC_KEY:
|
||||
from_secret: SSH_PUBLIC
|
||||
|
||||
steps:
|
||||
- name: Android
|
||||
image: mingc/android-build-box
|
||||
commands:
|
||||
- drone/deliver.sh android
|
||||
- drone/android-sign.sh
|
||||
- name: Electron
|
||||
image: ubuntu:latest
|
||||
commands:
|
||||
- drone/deliver.sh electron
|
||||
- name: Web
|
||||
image: ubuntu:latest
|
||||
commands:
|
||||
- drone/deliver.sh electron
|
||||
|
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
apt install apksigner > /dev/null
|
||||
|
||||
if [ $DRONE_BRANCH = "dev" ]; then
|
||||
ARTIFACT_TYPE="debug"
|
||||
elif [ $DRONE_BRANCH = "production" ]; then
|
||||
ARTIFACT_TYPE="release"
|
||||
fi
|
||||
|
||||
mv app-$ARTIFACT_TYPE-unsigned.apk tbasket-$ARTIFACT_TYPE.apk
|
||||
apksigner sign --ks /home/maxime/server/TBasket/application/android/tbasket.keystore tbasket-$ARTIFACT_TYPE.apk
|
||||
echo "apk has been signed."
|
@ -0,0 +1,45 @@
|
||||
#!/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"
|
Reference in new issue