Change building

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