diff --git a/build/Jenkinsfile b/build/Jenkinsfile index 35a0c82..c7e4719 100644 --- a/build/Jenkinsfile +++ b/build/Jenkinsfile @@ -14,14 +14,14 @@ node("docker") { error("stand не соответствует 'prod', 'test' или 'dev'") } - stage("Prepare environments") { + stage("Prepare environments") { envConfig = "build/vars/build.yaml" support.getVarsV2(envConfig) // пока не будет готов отдельный dev стенд env.namespace = "${env.namespace}-${stand}" env.registryContainerName = "${env.registryContainerName}-${stand}" - + env.version = sh(script: "git rev-parse HEAD", returnStdout: true).trim() println "Success prepare" } @@ -38,13 +38,14 @@ node("docker") { stage("Build image") { println "Start building image ${env.registryContainerName}:${env.version}" + app = docker.build("${env.registryContainerName}:${env.version}", "--no-cache -f ./build/Dockerfile .") println "Start uploading image ${env.registryContainerName}:${env.version} to Nexus" docker.withRegistry("https://${registryUrl}", "nexus-jenkins-cred") { app.push("${env.version}") app.push("latest") - } + } } stage("Update version in Kubernetes") { @@ -70,8 +71,8 @@ node("docker") { sh "kubectl --kubeconfig=auth.config get pods --namespace ${env.namespace}" } - } - + } + println "Success build job. Now start cleanup" cleanWs( @@ -80,4 +81,4 @@ node("docker") { ) } } -} \ No newline at end of file +}