-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
59 lines (57 loc) · 1.39 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
57
58
59
pipeline {
agent {
node {
label 'go'
}
}
environment {
DOCKERHUB_CREDENTIAL_ID = 'dockerhub-id'
}
stages {
stage('checkout scm ') {
steps {
checkout(scm)
}
}
stage('prepare') {
steps {
container('go') {
sh 'go get github.com/cpuguy83/go-md2man'
sh 'yum install distgen -y'
}
}
}
stage('base image build') {
steps {
container('go') {
sh '''git submodule update --init
make build TARGET=centos7 VERSIONS=base'''
}
}
}
stage('push to dockerhub'){
when {
branch 'master'
}
steps{
container('go'){
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKERHUB_CREDENTIAL_ID" ,)]) {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin'
}
sh 'docker tag kubespheredev/s2i-base-centos7 kubespheredev/s2i-base-centos7:2.1.0'
sh 'docker push kubespheredev/s2i-base-centos7'
}
}
}
stage('update language image'){
when{
branch 'master'
}
steps{
build job:'../s2i-java/master', wait: false
build job:'../s2i-python/master', wait: false
build job:'../s2i-nodejs/master', wait: false
}
}
}
}