build with latest tag?
This commit is contained in:
parent
e9bbf9d39a
commit
a45a7dd617
@ -1,6 +1,8 @@
|
|||||||
def repository = "registry.c.test-chamber-13.lan"
|
def repository = "registry.c.test-chamber-13.lan"
|
||||||
def repositoryCreds = "harbor-repository-creds"
|
def repositoryCreds = "harbor-repository-creds"
|
||||||
|
|
||||||
|
def workspace
|
||||||
|
def latestTag
|
||||||
def label = "kubernetes-${UUID.randomUUID().toString()}"
|
def label = "kubernetes-${UUID.randomUUID().toString()}"
|
||||||
def templateName = "pipeline-worker"
|
def templateName = "pipeline-worker"
|
||||||
def outputFile
|
def outputFile
|
||||||
@ -22,7 +24,43 @@ podTemplate(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
node (label) {
|
node (label) {
|
||||||
def workspace = pwd()
|
stage ('Initalize Jenkins') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
workspace = pwd()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage ('Get latest Tag') {
|
||||||
|
steps {
|
||||||
|
container ('alpine') {
|
||||||
|
script {
|
||||||
|
sh """
|
||||||
|
if ! command -v curl &> /dev/null; then
|
||||||
|
apk add --no-cache curl
|
||||||
|
fi
|
||||||
|
if ! command -v jq &> /dev/null; then
|
||||||
|
apk add --no-cache jq
|
||||||
|
fi
|
||||||
|
"""
|
||||||
|
latestTag = sh (
|
||||||
|
script: """
|
||||||
|
curl \
|
||||||
|
--location \
|
||||||
|
--silent \
|
||||||
|
--fail \
|
||||||
|
--request GET \
|
||||||
|
--url https://api.github.com/repos/signalapp/Signal-Desktop/releases/latest | \
|
||||||
|
jq -r 'select(.prerelease == false) | .tag_name[1:]'
|
||||||
|
""",
|
||||||
|
returnStdout: true
|
||||||
|
).trim()
|
||||||
|
println("Latest Tag: " + latestTag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage ("Clone Signal") {
|
stage ("Clone Signal") {
|
||||||
dir("signal-desktop") {
|
dir("signal-desktop") {
|
||||||
@ -30,7 +68,7 @@ podTemplate(
|
|||||||
$class: "GitSCM",
|
$class: "GitSCM",
|
||||||
branches: [
|
branches: [
|
||||||
[
|
[
|
||||||
name: "refs/heads/main",
|
name: "refs/tags/" + latestTag,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
userRemoteConfigs: [
|
userRemoteConfigs: [
|
||||||
|
Reference in New Issue
Block a user