-
Notifications
You must be signed in to change notification settings - Fork 53
/
Jenkinsfile
56 lines (51 loc) · 1.5 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
54
55
56
pipeline {
agent any
stages {
stage ('Build') {
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
sh 'mvn clean install -DskipTests -DCELLBASE.WAR.NAME=cellbase'
}
}
stage ('Validate') {
options {
timeout(time: 5, unit: 'MINUTES')
}
steps {
sh 'mvn validate'
}
}
stage ('Docker Build') {
options {
timeout(time: 25, unit: 'MINUTES')
}
steps {
sh 'docker build -t cellbase -f cellbase-app/app/docker/cellbase/Dockerfile .'
}
}
stage ('Publish Docker Images') {
options {
timeout(time: 25, unit: 'MINUTES')
}
steps {
script {
def tag = sh(returnStdout: true, script: "git rev-parse --verify HEAD").trim()
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
sh "docker tag cellbase opencb/cellbase:${tag}"
sh "docker push opencb/cellbase:${tag}"
}
}
}
}
stage ('Clean Docker Images') {
options {
timeout(time: 10, unit: 'MINUTES')
}
steps {
sh 'docker system prune --force -a'
}
}
}
}