-
Notifications
You must be signed in to change notification settings - Fork 14
/
Jenkinsfile_docker
43 lines (31 loc) · 956 Bytes
/
Jenkinsfile_docker
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
node {
stage 'checkout project'
git url: 'https://github.com/TrunkWorkshop/sailsSample.git'
stage 'check docker env'
sh "docker -v"
sh "docker-compose -v"
sh "docker ps"
stage 'build docker env'
sh "npm run build-docker-env"
stage 'build project'
sh "npm run build-docker"
stage 'test project'
sh "docker-compose run --rm test"
step([$class: 'JUnitResultArchiver', testResults: 'test-results.xml'])
stage 'run project'
sh "npm run start-docker"
try{
stage 'Approve, go production'
def url = 'http://localhost:8000/'
input message: "Does staging at $url look good? ", ok: "Deploy to production"
}finally{
sh "npm run stop-docker"
}
stage 'build docker production image'
sh "npm run build-docker-prod-image"
stage 'publish docker production image'
// sh "docker push agileworks/sails_sample_prod"
echo 'skip publish'
stage 'deploy production'
sh "make deploy-production-docker"
}