-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile
45 lines (44 loc) · 1.19 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
pipeline {
agent {
node {
label 'base'
}
}
stages {
stage('build and tag image') {
steps {
container('base') {
sh '''
wget -O s2i.tar.gz https://github.com/openshift/source-to-image/releases/download/v1.1.13/source-to-image-v1.1.13-b54d75d3-linux-amd64.tar.gz \
&& tar -xvf s2i.tar.gz \
&& cp ./s2i /usr/local/bin'''
sh './test.sh'
}
}
}
stage('docker tag') {
when{
branch 'master'
}
steps {
container('base') {
sh 'docker tag s2i-binary kubespheredev/s2i-binary'
sh 'docker tag s2i-binary kubespheredev/s2i-binary:2.1.0'
}
}
}
stage('docker push') {
when{
branch 'master'
}
steps {
container('base') {
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : 'dockerhub-id' ,)]) {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin'
}
sh 'docker push kubespheredev/s2i-binary'
}
}
}
}
}