-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
28 lines (28 loc) · 914 Bytes
/
Jenkinsfile
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
pipeline {
agent any
environment {
REMOTE_HOST = "${params.RemoteHost}"
REMOTE_STAGE_DIR = "${params.RemoteStageDir}"
REMOTE_PROD_DIR = "${params.RemoteProdDir}"
REMOTE_STAGE_URL = "${params.RemoteStageUrl}"
REMOTE_PROD_URL = "${params.RemoteProdUrl}"
}
stages {
stage('staging') {
steps {
sh 'make clean'
sh 'make build'
sh 'rsync -rz ./dist $REMOTE_HOST:$REMOTE_STAGE_DIR'
sh 'curl --silent --output /dev/null --show-error --fail $REMOTE_STAGE_URL'
}
}
stage('prod') {
steps {
sh 'make clean'
sh 'make build'
sh 'rsync -rz ./dist $REMOTE_HOST:$REMOTE_PROD_DIR'
sh 'curl --silent --output /dev/null --show-error --fail $REMOTE_PROD_URL'
}
}
}
}