-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
29 lines (29 loc) · 861 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
29
pipeline {
agent any
options {
buildDiscarder logRotator(numToKeepStr: '5')
}
stages {
stage('Zip') {
steps {
zip archive: true, dir: './', glob: '', zipFile: 'WebPage.zip'
}
}
stage('Docker Build') {
steps {
sh encoding: 'UTF-8', label: '', returnStdout: true, script: '''
docker build -t startyournode:1.0.0-${BUILD_NUMBER} .
docker tag startyournode:1.0.0-${BUILD_NUMBER} startyournode:latest
'''
}
}
stage('Docker Run') {
steps {
sh encoding: 'UTF-8', label: '', returnStdout: true, script: '''
/usr/bin/docker-compose down
/usr/bin/docker-compose up -d
'''
}
}
}
}