提交 f852ede0 编写于 作者: LinuxSuRen's avatar LinuxSuRen

use scm checkout object

上级 32d148ef
......@@ -12,7 +12,9 @@ pipeline {
stage("clone") {
steps {
dir(FOLDER) {
scmObj = checkout scm
script {
scmObj = checkout scm
}
}
}
}
......@@ -37,7 +39,7 @@ pipeline {
stage("image") {
environment {
IMAGE_TAG = scmObj.GIT_COMMIT
IMAGE_TAG = getCurrentCommit(scmObj)
}
steps {
container('tools'){
......@@ -53,7 +55,7 @@ pipeline {
stage("push-image") {
environment {
DOCKER_CREDS = credentials('docker-surenpi')
IMAGE_TAG = scmObj.GIT_COMMIT
IMAGE_TAG = getCurrentCommit(scmObj)
}
steps {
container('tools') {
......@@ -66,4 +68,8 @@ pipeline {
}
}
}
}
\ No newline at end of file
}
def getCurrentCommit(scmObj) {
return scmObj.GIT_COMMIT
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册