Compare commits

...

7 Commits

Author SHA1 Message Date
deployer3000 0742af6f92 Merge pull request 'Проверка1' (#9) from rc into main 2025-04-09 16:54:54 +03:00
yuobrezkov 46172a59a7 Проверка6
test-org/test-ci-cd/pipeline/pr-main This commit looks good Details
2025-04-09 16:53:33 +03:00
yuobrezkov 23700c92af Проверка5
test-org/test-ci-cd/pipeline/pr-main There was a failure building this commit Details
2025-04-09 16:49:50 +03:00
yuobrezkov 82b6a1b765 Проверка4
test-org/test-ci-cd/pipeline/pr-main There was a failure building this commit Details
2025-04-09 16:45:31 +03:00
yuobrezkov 00d3927df6 Проверка3
test-org/test-ci-cd/pipeline/pr-main There was a failure building this commit Details
2025-04-09 16:42:34 +03:00
yuobrezkov 8cc0fe3dd7 Проверка2
test-org/test-ci-cd/pipeline/pr-main There was a failure building this commit Details
2025-04-09 16:41:26 +03:00
yuobrezkov f1a8594a2f Проверка1
test-org/test-ci-cd/pipeline/pr-main There was a failure building this commit Details
2025-04-09 16:38:52 +03:00
1 changed files with 8 additions and 4 deletions

12
Jenkinsfile vendored
View File

@ -30,10 +30,13 @@ pipeline {
stage ('Initialize variables') {
steps {
script {
def lastVersion = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim()
def hasTags = sh(script: "git tag -l | wc -l", returnStdout: true).trim().toInteger() > 0
echo "${hasTags}"
if (!lastVersion) {
lastVersion = "0.0.0"
def lastVersion = "0.0.0"
if (hasTags) {
lastVersion = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim()
}
echo "Last version: ${lastVersion}"
@ -85,10 +88,11 @@ pipeline {
def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim()
withCredentials([usernamePassword(credentialsId: 'gitea_creds', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) {
def prId = env.CHANGE_ID
echo "GIT_COMMIT: ${env.GIT_COMMIT}"
sh """
curl -v -X POST -u "${GITEA_USER}:${GITEA_PASS}" \
-H "Content-Type: application/json" \
-d '{"tag_name": "${env.NEW_VERSION}", "name": "Release ${env.NEW_VERSION}", "target_commitish": "${commitHash}"}' \
-d '{"tag_name": "${env.NEW_VERSION}", "name": "Release ${env.NEW_VERSION}", "target_commitish": "${env.GIT_COMMIT}"}' \
"${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases"
"""
echo "New release succeeded!"