forked from Adedoyin-Emmanuel/react-weather-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
53 lines (52 loc) · 1.46 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
pipeline {
agent none
stages{
stage("Test"){
agent {
docker {
image 'node:lts-alpine'
args '-u root:root'
}
}
steps{
sh "chmod +x -R ${env.WORKSPACE}"
sh './scripts/test.sh'
}
}
stage("Build"){
agent {
docker {
image 'node:lts-alpine'
args '-u root:root'
}
}
steps{
sh "chmod +x -R ${env.WORKSPACE}"
sh "npm install"
sh "./scripts/deliver-for-development.sh"
}
}
stage("Deliver for Development"){
agent any
when {
branch "development"
}
steps{
sh 'sudo rm -rf /var/www/jenkins-weather-app'
sh "sudo cp -r ${env.WORKSPACE}/build /var/www/jenkins-weather-app"
sh "sudo ls /var/www/jenkins-weather-app"
// sh './scripts/kill.sh'
}
}
stage("Deploy for Production"){
when {
branch "production"
}
steps {
sh './scripts/deploy-for-production.sh'
input message: 'Finished using the web site? (Click "Proceed" to continue)'
sh './scripts/kill.sh'
}
}
}
}