含羞草
好记性不如烂笔头
菜鸟先飞...

// Get checkout output value
def changeLogSets = checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'ec796dd7-3b23-4f68-8475-530f8cb03c9c', url: 'http://10.45.156.100/jenkinsfile/icloud3.12.git/']]])
GIT_COMMIT = changeLogSets['GIT_COMMIT']
echo "$GIT_COMMIT"
            
// Git committer email
GIT_COMMIT_EMAIL = sh (
    script: "git --no-pager show -s --format='%ae' $GIT_COMMIT",
     returnStdout: true
).trim()
// Git committer name
GIT_COMMIT_NAME = sh (
    script: "git --no-pager show -s --format='%an' $GIT_COMMIT",
    returnStdout: true
).trim()
echo "Git committer name: ${GIT_COMMIT_NAME}"
echo "Git committer email: ${GIT_COMMIT_EMAIL}"

posted on 2018-10-30 17:07  含羞草  阅读(2278)  评论(0编辑  收藏  举报