rc #2
|
|
@ -31,11 +31,7 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
withCredentials([usernamePassword(credentialsId: 'gitea_creds', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) {
|
withCredentials([usernamePassword(credentialsId: 'gitea_creds', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) {
|
||||||
def lastVersion = sh(script: """
|
lastVersion = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim()
|
||||||
curl -s -u "${GITEA_USER}:${GITEA_PASS}" \
|
|
||||||
"${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases" | \
|
|
||||||
sed -n 's/.*"tag_name": *"\\([^"]*\\).*/\\1/p' | sort -V | tail -n1
|
|
||||||
""", returnStdout: true).trim()
|
|
||||||
|
|
||||||
if (!lastVersion) {
|
if (!lastVersion) {
|
||||||
lastVersion = "0.0.0"
|
lastVersion = "0.0.0"
|
||||||
|
|
@ -103,7 +99,7 @@ pipeline {
|
||||||
echo "New release succeeded!"
|
echo "New release succeeded!"
|
||||||
def context = "test-org/trust-module-backend/pipeline/pr-${env.CHANGE_TARGET}"
|
def context = "test-org/trust-module-backend/pipeline/pr-${env.CHANGE_TARGET}"
|
||||||
def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim()
|
def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim()
|
||||||
notify(context, GITEA_USER, GITEA_PASS, env.GITEA_REPOSITORY_URL, "trust-module-backend", commitHash, "success")
|
notify(context, GITEA_USER, GITEA_PASS, env.GITEA_REPOSITORY_URL, env.IMAGE_NAME, commitHash, "success")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue