File tree Expand file tree Collapse file tree 1 file changed +20
-11
lines changed
src/releases/docker-build Expand file tree Collapse file tree 1 file changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -75,17 +75,26 @@ pipeline {
75
75
}
76
76
steps {
77
77
sh ' git config --local credential.helper "!f() { echo username=\\ ${GIT_AUTH_USR}; echo password=\\ $GIT_AUTH_PSW; }; f"'
78
- sh """
79
- sed -i -e "s/WILDFLY_VERSION=[0-9.]\\ +/WILDFLY_VERSION=${ params.WILDFLY_VERSION} /g" Dockerfile
80
- sed -i -e "s/JAVA_VERSION=[0-9]\\ +/JAVA_VERSION=${ params.JAVA_VERSION} /g" Dockerfile
81
- sed -i -e "s/SONAR_JAVA_VERSION=[0-9]\\ +/SONAR_JAVA_VERSION=${ params.SONAR_JAVA_VERSION} /g" Dockerfile
82
- sed -i -e "s/version=[0-9.]\\ +/version=${ params.IMAGE_VERSION} /g" Dockerfile
83
- sed -i -e "s/build=.\\ +/build=1/g" Dockerfile
84
- git commit -am "Update Dockerfile for building and registering image ${ params.IMAGE_VERSION} "
85
- git push origin HEAD:master
86
- git tag ${ params.IMAGE_VERSION}
87
- git push origin --tags
88
- """
78
+ script {
79
+ String status = sh script : """
80
+ sed -i -e "s/WILDFLY_VERSION=[0-9.]\\ +/WILDFLY_VERSION=${ params.WILDFLY_VERSION} /g" Dockerfile
81
+ sed -i -e "s/JAVA_VERSION=[0-9]\\ +/JAVA_VERSION=${ params.JAVA_VERSION} /g" Dockerfile
82
+ sed -i -e "s/SONAR_JAVA_VERSION=[0-9]\\ +/SONAR_JAVA_VERSION=${ params.SONAR_JAVA_VERSION} /g" Dockerfile
83
+ sed -i -e "s/version=[0-9.]\\ +/version=${ params.IMAGE_VERSION} /g" Dockerfile
84
+ sed -i -e "s/build=.\\ +/build=1/g" Dockerfile
85
+ git diff --quiet
86
+ """ , returnStatus : true
87
+ if (status == ' 1' ) {
88
+ sh """
89
+ git commit -am "Update Dockerfile for building and registering image ${ params.IMAGE_VERSION} "
90
+ git push origin HEAD:master
91
+ """
92
+ }
93
+ sh """
94
+ git tag ${ params.IMAGE_VERSION}
95
+ git push origin --tags
96
+ """
97
+ }
89
98
}
90
99
}
91
100
stage(' Update current latest version' ) {
You can’t perform that action at this time.
0 commit comments