Compare commits

..

1 Commits

Author SHA1 Message Date
William Bell
8561f6d762 test 2025-12-01 03:40:00 +00:00

60
Jenkinsfile vendored
View File

@@ -26,11 +26,6 @@ pipeline {
} }
// update submodules // update submodules
sh '''
git fetch --tags
latest_tag=$(git describe --tags --abbrev=0)
git checkout tags/$latest_tag
'''
sh 'git submodule update --init --recursive' sh 'git submodule update --init --recursive'
} }
} }
@@ -40,30 +35,17 @@ pipeline {
stage('Detect Tag') { stage('Detect Tag') {
steps { steps {
script { script {
echo "REF from Gitea: ${env.GITEA_REF}"
echo "GIT_BRANCH: ${env.GIT_BRANCH}"
echo "GIT_TAG: ${env.GIT_TAG}"
def ref = sh(script: "git rev-parse --symbolic-full-name HEAD", returnStdout: true).trim() def tag = sh(script: "git describe --tags --exact-match", returnStdout: true).trim()
if (ref.startsWith('refs/tags/')) { echo "Tag detected: ${tag}"
def tag = ref.replace('refs/tags/', '')
echo "Tag detected: ${tag}"
if (tag.toLowerCase().contains('unsable')) { if (tag.toLowerCase().contains('unsable')) {
echo "Tag contains 'unsable' → marking build UNSTABLE" echo "Tag contains 'unsable' → marking build UNSTABLE"
currentBuild.result = 'UNSTABLE' currentBuild.result = 'UNSTABLE'
}
// Expose for other stages
env.TAG_NAME = tag
} else {
// Normal branch push = DEV build
def branchName = ref.replace("refs/heads/", "")
echo "Regular branch build: ${branchName}"
// Mark display name as a dev build
currentBuild.displayName = "#${env.BUILD_NUMBER} DEV-${branchName}"
} }
// Expose for other stages
env.TAG_NAME = tag
} }
} }
} }
@@ -143,26 +125,16 @@ stage('Archive Build Artifacts') {
always { always {
script { script {
// Automatically detects full ref name // Automatically detects full ref name
def ref = sh(script: "git rev-parse --symbolic-full-name HEAD", returnStdout: true).trim() def tag = sh(script: "git describe --tags --exact-match", returnStdout: true).trim()
echo "Detected tag: ${tag}"
if (ref.startsWith("refs/tags/")) { if (tag.toLowerCase().contains("unstable")) {
// Extract tag name echo "Unstable tag detected"
def tag = ref.replace("refs/tags/", "")
echo "Detected tag: ${tag}"
if (tag.toLowerCase().contains("unstable")) {
echo "Unstable tag detected"
currentBuild.result = "UNSTABLE"
} else {
echo "Stable tagged build"
currentBuild.description = "Stable"
currentBuild.result = "SUCCESS"
}
} else {
currentBuild.result = "UNSTABLE" currentBuild.result = "UNSTABLE"
echo "Regular commit → marking as dev build" } else {
currentBuild.description = "Dev Build" echo "Stable tagged build"
currentBuild.description = "Stable"
currentBuild.result = "SUCCESS"
} }
} }
} }