-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathJenkinsfile
34 lines (29 loc) · 896 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
30
31
32
33
34
node ('master') {
def app
def version
stage('Cloning repository') {
checkout scm
env.WORKSPACE = pwd()
sh '''cat version.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",}]//g' > version.txt'''
version = readFile('version.txt').trim()
}
stage('Building Docker image') {
app = docker.build("relevancelab/catalyst-core")
}
stage('Quality Check') {
/*input "Confirm the quality?"*/
app.inside {
sh 'echo "Manualy test passed"'
}
}
stage('Push Docker image') {
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
app.push("${version}_b${env.BUILD_NUMBER}")
app.push("latest")
}
}
stage('Cleanup'){
// Cleanup docker images
sh 'echo "Cleaning images"'
}
}