-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
46 lines (40 loc) · 1.16 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
node('bagel') {
echo "let's get it started"
stage('code') {
dir('nodeLoc') {
//credentials are configured in Jenkins
//git credentialsId: 'kwhetstone_github', url: 'http://github.com/kwhetstone/ath_demo/'
scm checkout
}
}
def ato_app
stage('build') {
dir('nodeLoc') {
sh 'npm install'
}
ato_app = docker.build("kwhetstone/ato_demo:${env.BUILD_TAG}", 'nodeLoc')
}
stage('test') {
echo 'Launch the docker container for testing'
def toTest = ato_app.run()
dir('nodeLoc') {
sh 'npm test'
junit '*.xml'
}
toTest.stop()
}
milestone label: 'prod'
echo "Only the most recent build will be deployed"
stage('deploy') {
echo 'This will be the external deploy'
//push to dockerhub; credentials definied in Jenkins
docker.withRegistry("https://registry.hub.docker.com", 'kwhetstone_dockerhub') {
ato_app.push 'latest'
}
}
stage('cleanup') {
dir('nodeLoc') {
deleteDir() //cleanup!
}
}
}