Correct version get for build

This commit is contained in:
2025-02-04 11:24:12 +03:00
parent 6b937e1d76
commit 30d471d33a
+10 -11
View File
@@ -19,11 +19,9 @@ node("docker") {
support.getVarsV2(envConfig) support.getVarsV2(envConfig)
// пока не будет готов отдельный dev стенд // пока не будет готов отдельный dev стенд
env.namespace = "${env.namespace}-${stand}" namespace = "${env.namespace}-${stand}"
env.registryContainerName = "${env.registryContainerName}-${stand}" registryContainerName = "${env.registryContainerName}-${stand}"
version = sh(script: "git rev-parse HEAD", returnStdout: true).trim()
env.version = sh(script: "grep 'variables.framework.docs.APIVersion=' v1/Application.cfc | awk -F '\"' '{print\$2}'", returnStdout: true).trim()
println "Success prepare" println "Success prepare"
} }
@@ -38,13 +36,14 @@ node("docker") {
} }
stage("Build image") { stage("Build image") {
println "Start building image ${env.registryContainerName}:${env.version}" println "Start building image ${registryContainerName}:${version}"
app = docker.build("${env.registryContainerName}:${env.version}", "--no-cache -f ./build/Dockerfile .")
println "Start uploading image ${env.registryContainerName}:${env.version} to Nexus" app = docker.build("${registryContainerName}:${version}", "--no-cache -f ./build/Dockerfile .")
println "Start uploading image ${registryContainerName}:${version} to Nexus"
docker.withRegistry("https://${registryUrl}", "nexus-jenkins-cred") { docker.withRegistry("https://${registryUrl}", "nexus-jenkins-cred") {
app.push("${env.version}") app.push("${version}")
app.push("latest") app.push("latest")
} }
} }
@@ -65,12 +64,12 @@ node("docker") {
helm upgrade --wait \ helm upgrade --wait \
--kubeconfig auth.config \ --kubeconfig auth.config \
--install \ --install \
--namespace ${env.namespace} \ --namespace ${namespace} \
-f ./helm/values.yaml \ -f ./helm/values.yaml \
${env.appName} ./helm/ ${env.appName} ./helm/
""" """
sh "kubectl --kubeconfig=auth.config get pods --namespace ${env.namespace}" sh "kubectl --kubeconfig=auth.config get pods --namespace ${namespace}"
} }
} }