-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
63 lines (63 loc) · 2.21 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
pipeline {
agent none
stages {
stage('Retrieve Latest Data') {
agent {
docker { image 'python:3' }
}
steps {
sh 'pip install -r requirements.txt'
sh 'python download_latest.py'
sh 'python convert_latest.py'
stash(name: 'latest_data', includes: 'data/latest_data.json')
}
}
stage('Build Website') {
agent {
docker { image 'node:14-alpine' }
}
steps {
unstash('latest_data')
dir('website') {
sh 'yarn'
sh 'yarn run build'
// archiveArtifacts artifacts: 'public/**/*'
stash(name: 'website', includes: 'public/**/*')
}
}
}
stage('Deploy to VPS') {
agent {
docker { image 'ubuntu' }
}
steps {
unstash('website')
sshPublisher(
publishers: [
sshPublisherDesc(
configName: 'devvps',
transfers: [
sshTransfer(
cleanRemote: true,
excludes: '',
execCommand: '',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: true,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '/home/covid19/website',
remoteDirectorySDF: false,
sourceFiles: 'public/**/*'
)
],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false
)
]
)
}
}
}
}