diff --git a/drone/.drone.yml b/drone/.drone.yml index 5a30923..5a474cf 100644 --- a/drone/.drone.yml +++ b/drone/.drone.yml @@ -1,11 +1,12 @@ kind: pipeline type: docker -name: Deliver -mode: parallel +name: Android steps: - - name: Android - image: override6/tbasket-frontend + - name: Deliver + image: override6/tbasket-frontend:latest + workspace: + path: /src/android environment: SSH_PRIVATE_KEY: from_secret: SSH_PRIVATE @@ -14,8 +15,18 @@ steps: commands: - bash drone/deliver.sh android - bash drone/android-sign.sh - - name: Electron - image: override6/tbasket-frontend + +--- + +kind: pipeline +type: docker +name: Electron + +steps: + - name: Deliver + image: override6/tbasket-frontend:latest + workspace: + path: /src/electron environment: SSH_PRIVATE_KEY: from_secret: SSH_PRIVATE @@ -23,8 +34,18 @@ steps: from_secret: SSH_PUBLIC commands: - bash drone/deliver.sh electron - - name: Web - image: override6/tbasket-frontend + +--- + +kind: pipeline +type: docker +name: Apache + +steps: + - name: Deliver + image: override6/tbasket-frontend:latest + workspace: + path: /src/web environment: SSH_PRIVATE_KEY: from_secret: SSH_PRIVATE @@ -32,8 +53,3 @@ steps: from_secret: SSH_PUBLIC commands: - bash drone/deliver.sh browser - - - name: dummy - image: ubuntu:latest - depends_on: - - "Web" \ No newline at end of file diff --git a/drone/deliver.sh b/drone/deliver.sh index 662e664..097eea0 100755 --- a/drone/deliver.sh +++ b/drone/deliver.sh @@ -47,11 +47,14 @@ esac #install cordova -cordova platform add "$TYPE" -cordova build "$TYPE" $OPTIONS +cordova platform add "$TYPE" || exit 1 +cordova build "$TYPE" $OPTIONS || exit 1 echo "delivering outputs on server" echo "making delivery onto '$USER@$IP:$SERV_DIR'" -scp -o "StrictHostKeyChecking no" -r "$OUT_DIR" "$USER@$IP:$SERV_DIR" \ No newline at end of file +rsync -avz -I \ + --rsync-path="mkdir -p \"$SERV_DIR\" && rsync" \ + -e "ssh -o StrictHostKeyChecking=no" \ + --delete "$OUT_DIR" "$USER@$IP" \ No newline at end of file diff --git a/drone/image/Dockerfile b/drone/image/Dockerfile index f335d94..c6cf50c 100644 --- a/drone/image/Dockerfile +++ b/drone/image/Dockerfile @@ -1,3 +1,4 @@ FROM alvrme/alpine-android:android-32-jdk11 -RUN (apk update && apk add npm openssh-client tree) &&\ - npm install -g cordova +RUN apk update \ + && apk add npm openssh-client tree rsync \ + && npm install -g cordova