change build way
This commit is contained in:
Vendored
+11
-10
@@ -10,13 +10,15 @@ node("docker") {
|
||||
|
||||
stage("Prepare environments") {
|
||||
if (env.BRANCH_NAME == 'master')
|
||||
envConfig = "build/vars/master.yaml"
|
||||
env.stand = "prod"
|
||||
else if (env.BRANCH_NAME == 'dev')
|
||||
envConfig = "build/vars/dev.yaml"
|
||||
env.stand = "test"
|
||||
else
|
||||
error("Unsupported branch: ${env.BRANCH_NAME}")
|
||||
|
||||
envConfig = "build/vars/build.yaml"
|
||||
support.getVarsV2(envConfig)
|
||||
|
||||
println "Success prepare"
|
||||
}
|
||||
|
||||
@@ -35,15 +37,14 @@ node("docker") {
|
||||
|
||||
stage("Update version in Kubernetes") {
|
||||
dir ("build") {
|
||||
// Надо создать пачку кредов в Jenkins, а также пространство с кредами подключения в Vault
|
||||
creds = ["auth", "certificate", "key", "k8scluster", "endpoint"]
|
||||
|
||||
creds.each { cred ->
|
||||
withCredentials([vaultString(credentialsId: "${env.registryContainerName}-${cred}-${stand}", variable: "key")]) {
|
||||
env."${cred}" = key
|
||||
}
|
||||
withCredentials([vaultString(credentialsId: "config.${env.registryContainerName}-${env.stand}", variable: "pem")]) {
|
||||
sh """
|
||||
set +x
|
||||
echo "${pem}" | base64 -d > auth.config
|
||||
set -x
|
||||
"""
|
||||
}
|
||||
convertJinja("auth.config.tmpl", "auth.config")
|
||||
|
||||
convertJinja("microservice.yaml.tmpl", "microservice.yaml")
|
||||
|
||||
sh "kubectl --kubeconfig=auth.config get pods --namespace ${env.namespace}"
|
||||
|
||||
Reference in New Issue
Block a user