Compare commits
4 Commits
gitea-rele
...
cpkg-auto-
Author | SHA1 | Date | |
---|---|---|---|
bcf34404a2 | |||
45ff14ce10 | |||
97352aad87 | |||
502c2c7ed9 |
@ -45,7 +45,7 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
junit "*.xml"
|
||||
junit testResults: '*.xml', skipPublishingChecks: true
|
||||
|
||||
rocketSend (
|
||||
channel: "#cnous-mse",
|
||||
|
@ -1,7 +1,7 @@
|
||||
ARG PHP_SECURITY_CHECKER_VERSION=1.0.0
|
||||
ARG JQ_VERSION=1.6
|
||||
|
||||
RUN apt update && \
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
wget tar curl ca-certificates \
|
||||
openssl bash git unzip \
|
||||
|
@ -44,7 +44,7 @@ def call(Map params = [:]) {
|
||||
} else {
|
||||
println("Skipping push. Set skipPush param to 'true' to enable remote repository update.")
|
||||
}
|
||||
|
||||
|
||||
// Retrieve last tag matching pattern pkg/${distRepo}/${dist}-${distVersion}/*
|
||||
def lastTag = sh(
|
||||
script: "git tag -l 'pkg/${distRepo}/${dist}-${distVersion}/*' --sort=v:refname | tail -n 1",
|
||||
@ -61,7 +61,16 @@ def call(Map params = [:]) {
|
||||
|
||||
println("Last version number is '${lastVersionNumber}'")
|
||||
|
||||
def versionNumber = incrementVersionNumber(lastVersionNumber)
|
||||
def versionNumber = sh(
|
||||
script: "git describe --always ${currentRef}",
|
||||
returnStdout: true,
|
||||
).trim()
|
||||
|
||||
def isCommitRef = !versionNumber.matches(/^[0-9]+\.[0-9]+\.[0-9]+.*$/)
|
||||
|
||||
if (isCommitRef) {
|
||||
versionNumber = "0.0.0-${versionNumber}"
|
||||
}
|
||||
|
||||
println("New version number will be '${versionNumber}'")
|
||||
result['newVersionNumber'] = versionNumber
|
||||
@ -106,22 +115,4 @@ def call(Map params = [:]) {
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
def incrementVersionNumber(String versionNumber) {
|
||||
// Split versionNumber (typical pattern: <major>.<minor>.<patch>)
|
||||
def versionNumberParts = versionNumber.split(/\./)
|
||||
|
||||
// Extract path number
|
||||
def patchNumber = versionNumberParts.last()
|
||||
|
||||
// Split patch number (typical pattern: <patch>-<build>)
|
||||
def patchNumberParts = patchNumber.split('-')
|
||||
|
||||
// If version number matches pattern <major>.<minor>.<patch>-<build>
|
||||
if (patchNumberParts.size() > 1) {
|
||||
return versionNumberParts[0..-2].join('.') + '.' + patchNumberParts[0..-2].join('-') + '-' + (patchNumberParts.last().toInteger() + 1)
|
||||
} else { // Else version number matches pattern <major>.<minor>.<patch>
|
||||
return versionNumberParts[0..-2].join('.') + '.' + (patchNumber.toInteger() + 1)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user