This commit is contained in:
William Bell
2025-12-01 03:40:00 +00:00
parent 1e21a7f11c
commit 8561f6d762

32
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,13 +35,8 @@ 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/')) {
def tag = ref.replace('refs/tags/', '')
echo "Tag detected: ${tag}" echo "Tag detected: ${tag}"
if (tag.toLowerCase().contains('unsable')) { if (tag.toLowerCase().contains('unsable')) {
@@ -56,14 +46,6 @@ pipeline {
// Expose for other stages // Expose for other stages
env.TAG_NAME = tag 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}"
}
} }
} }
} }
@@ -143,11 +125,7 @@ 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()
if (ref.startsWith("refs/tags/")) {
// Extract tag name
def tag = ref.replace("refs/tags/", "")
echo "Detected tag: ${tag}" echo "Detected tag: ${tag}"
if (tag.toLowerCase().contains("unstable")) { if (tag.toLowerCase().contains("unstable")) {
@@ -158,12 +136,6 @@ stage('Archive Build Artifacts') {
currentBuild.description = "Stable" currentBuild.description = "Stable"
currentBuild.result = "SUCCESS" currentBuild.result = "SUCCESS"
} }
} else {
currentBuild.result = "UNSTABLE"
echo "Regular commit → marking as dev build"
currentBuild.description = "Dev Build"
}
} }
} }
} }