-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
44 lines (42 loc) · 1.31 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
kind: pipeline
type: docker
name: build-java-amd64
platform:
os: linux
arch: amd64
steps:
- name: build
image: adoptopenjdk/openjdk12:alpine
commands:
- cat /etc/issue
- java -version
- apk add maven
- mvn -version
- mvn package -pl patcher
- mvn package -pl gui
- ls -lah gui/target
- ls -lah patcher/target
- name: artifacts
image: alpine:latest
commands:
- cat /etc/issue
- apk add --no-cache openssh-client ca-certificates sshpass
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- export REMOTE_PATH=/data/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_BRANCH}/$(date +'%Y%m%d-%H%M%S')-${DRONE_COMMIT_SHA:0:9}/
- export SSHPASS=$${REMOTE_PASSWORD}
- sshpass -e ssh $${REMOTE_USERNAME}@$${REMOTE_HOST} "mkdir -p $REMOTE_PATH"
- "sshpass -e scp -r gui/target/*.jar $${REMOTE_USERNAME}@$${REMOTE_HOST}:$REMOTE_PATH"
- "sshpass -e scp -r patcher/target/*.jar $${REMOTE_USERNAME}@$${REMOTE_HOST}:$REMOTE_PATH"
environment:
REMOTE_USERNAME:
from_secret: remote_username
REMOTE_PASSWORD:
from_secret: remote_password
REMOTE_HOST:
from_secret: remote_host
when:
event:
- push
- tag