diff --git a/Jenkinsfile b/Jenkinsfile index fb306e7..0b6865f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -135,9 +135,7 @@ pipeline { sh("git config --global user.email $_MaintainerEmail") sh("git config --global user.name $_MaintainerName") - withCredentials([usernamePassword(credentialsId: _SCMCredentials, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { - sh("git remote set-url origin https://${GIT_USERNAME}:${GIT_PASSWORD}@chacha.ddns.net/gitea/${_PROJECT_USER_NAME}/${_PROJECT_NAME}.git") - } + } } @@ -151,6 +149,11 @@ pipeline { extensions: [[$class: "CloneOption", noTags: false, shallow: false, depth: 0, reference: '']], userRemoteConfigs: [[credentialsId: _SCMCredentials, url: GIT_URL]]]) script{ + + withCredentials([usernamePassword(credentialsId: _SCMCredentials, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { + sh("git remote set-url origin https://${GIT_USERNAME}:${GIT_PASSWORD}@chacha.ddns.net/gitea/${_PROJECT_USER_NAME}/${_PROJECT_NAME}.git") + } + // using git to get the latest tag on this branch (before processing) def latestTag_beforeProcessing = sh(returnStdout: true, script: "git tag --sort=-creatordate | head -n 1").trim() echo("latestTag_beforeProcessing:. . . . . . . . . . . . $latestTag ")