From eef68fe362328fa75dfe2021896577655dac195d Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Mon, 11 Dec 2017 19:10:47 +0300 Subject: [PATCH 01/18] EVOADMIN-481 Add jenkinsfile and dockerfile --- .dockerignore | 3 +++ .gitignore | 2 ++ Dockerfile | 2 ++ Jenkinsfile | 29 +++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5d57188 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +Jenkinsfile +.git diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a126c27 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0f9de79 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:1.13.1 +COPY . /usr/share/nginx/html/ diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..a8e9019 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,29 @@ +pipeline { + agent any + triggers { + pollSCM '* * * * *' + } + options { + buildDiscarder(logRotator(numToKeepStr: '10')) + } + stages { + stage('Build') { + sh "docker build -t docker-registry.market.local/documentation-api:$BUILD_TAG ." + } + stage('Publish') { + steps { + sh "docker push docker-registry.market.local/documentation-api:$BUILD_TAG" + } + } + stage('Deploy') { + steps { + kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") + } + } + } + post { + always { + reportToTelegram() + } + } +} From 275aef9089f282be174392aecefc15bd8ebe5890 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Mon, 11 Dec 2017 19:13:45 +0300 Subject: [PATCH 02/18] EVOADMIN-481 Fix steps --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a8e9019..38defae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,9 @@ pipeline { } stages { stage('Build') { - sh "docker build -t docker-registry.market.local/documentation-api:$BUILD_TAG ." + steps { + sh "docker build -t docker-registry.market.local/documentation-api:$BUILD_TAG ." + } } stage('Publish') { steps { From 795e21fcc8a135ac7f79a6ed82a4742fa4c688fa Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Mon, 11 Dec 2017 19:25:34 +0300 Subject: [PATCH 03/18] EVOADMIN-481 Add ignore files --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.dockerignore b/.dockerignore index 5d57188..1d0cfbc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,5 @@ Dockerfile Jenkinsfile .git +.gitignore +.dockerignore From da54504a748bd9196207e9c6dfed7b878b4f0118 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Mon, 11 Dec 2017 19:36:05 +0300 Subject: [PATCH 04/18] EVOADMIN-481 Build master branch only --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 38defae..be5e901 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,16 +8,25 @@ pipeline { } stages { stage('Build') { + when { + branch 'master' + } steps { sh "docker build -t docker-registry.market.local/documentation-api:$BUILD_TAG ." } } stage('Publish') { + when { + branch 'master' + } steps { sh "docker push docker-registry.market.local/documentation-api:$BUILD_TAG" } } stage('Deploy') { + when { + branch 'master' + } steps { kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") } From bd3ac6226cda24fcf6ff792b5713deeca028e79d Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 11:58:17 +0300 Subject: [PATCH 05/18] EVOADMIN-481 Deploy with helm --- .dockerignore | 1 + Jenkinsfile | 11 +------ helm/documentation-api/Chart.yaml | 4 +++ .../templates/deployment.yaml | 29 +++++++++++++++++++ helm/documentation-api/templates/ingress.yaml | 21 ++++++++++++++ helm/documentation-api/templates/service.yaml | 13 +++++++++ helm/documentation-api/values.yaml | 15 ++++++++++ helm/values/prod.yaml | 2 ++ helm/values/test.yaml | 4 +++ 9 files changed, 90 insertions(+), 10 deletions(-) create mode 100644 helm/documentation-api/Chart.yaml create mode 100644 helm/documentation-api/templates/deployment.yaml create mode 100644 helm/documentation-api/templates/ingress.yaml create mode 100644 helm/documentation-api/templates/service.yaml create mode 100644 helm/documentation-api/values.yaml create mode 100644 helm/values/prod.yaml create mode 100644 helm/values/test.yaml diff --git a/.dockerignore b/.dockerignore index 1d0cfbc..84fdf9a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,4 @@ Jenkinsfile .git .gitignore .dockerignore +helm diff --git a/Jenkinsfile b/Jenkinsfile index be5e901..1fce8f2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,27 +8,18 @@ pipeline { } stages { stage('Build') { - when { - branch 'master' - } steps { sh "docker build -t docker-registry.market.local/documentation-api:$BUILD_TAG ." } } stage('Publish') { - when { - branch 'master' - } steps { sh "docker push docker-registry.market.local/documentation-api:$BUILD_TAG" } } stage('Deploy') { - when { - branch 'master' - } steps { - kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") + kubeRolloutWithHelm('test-cluster', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "$BUILD_TAG") } } } diff --git a/helm/documentation-api/Chart.yaml b/helm/documentation-api/Chart.yaml new file mode 100644 index 0000000..4a999f0 --- /dev/null +++ b/helm/documentation-api/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: api.evotor.ru documentation +name: documentation-api +version: 0.1.0 diff --git a/helm/documentation-api/templates/deployment.yaml b/helm/documentation-api/templates/deployment.yaml new file mode 100644 index 0000000..9eb2abd --- /dev/null +++ b/helm/documentation-api/templates/deployment.yaml @@ -0,0 +1,29 @@ +apiVersion: apps/v1beta1 +kind: Deployment +metadata: + labels: + app: {{ .Chart.Name }} + name: {{ .Chart.Name }} +spec: + replicas: {{ .Values.replicaCount }} + strategy: + type: RollingUpdate + template: + metadata: + labels: + app: {{ .Chart.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + ports: + - name: http + containerPort: {{ .Values.service.internalPort }} + readinessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 15 + periodSeconds: 5 + resources: +{{ toYaml .Values.resources | indent 10}} diff --git a/helm/documentation-api/templates/ingress.yaml b/helm/documentation-api/templates/ingress.yaml new file mode 100644 index 0000000..c57ecaf --- /dev/null +++ b/helm/documentation-api/templates/ingress.yaml @@ -0,0 +1,21 @@ +{{- if .Values.ingress.enabled -}} +{{- $servicePort := .Values.service.internalPort -}} +{{- $serviceName := .Values.service.name}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ .Chart.Name }} + labels: + app: {{ .Chart.Name }} +spec: + rules: + {{- range $host := .Values.ingress.hosts }} + - host: {{ $host }} + http: + paths: + - path: / + backend: + serviceName: {{ $serviceName }} + servicePort: {{ $servicePort }} + {{- end -}} +{{- end -}} \ No newline at end of file diff --git a/helm/documentation-api/templates/service.yaml b/helm/documentation-api/templates/service.yaml new file mode 100644 index 0000000..088a425 --- /dev/null +++ b/helm/documentation-api/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: {{ .Chart.Name }} + name: {{ .Values.service.name }} +spec: + ports: + - name: app + port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + selector: + app: {{ .Chart.Name }} \ No newline at end of file diff --git a/helm/documentation-api/values.yaml b/helm/documentation-api/values.yaml new file mode 100644 index 0000000..a7d56c2 --- /dev/null +++ b/helm/documentation-api/values.yaml @@ -0,0 +1,15 @@ +replicaCount: 2 +image: + repository: docker-registry.market.local/documentation-api + tag: jenkins-devops-devops-documentation-api-2 +service: + name: documentation-api + externalPort: 80 + internalPort: 80 +ingress: + enabled: false + hosts: [] + annotations: +resources: + limits: + memory: 200Mi diff --git a/helm/values/prod.yaml b/helm/values/prod.yaml new file mode 100644 index 0000000..9c60e56 --- /dev/null +++ b/helm/values/prod.yaml @@ -0,0 +1,2 @@ +ingress: + enabled: false diff --git a/helm/values/test.yaml b/helm/values/test.yaml new file mode 100644 index 0000000..6bd2572 --- /dev/null +++ b/helm/values/test.yaml @@ -0,0 +1,4 @@ +ingress: + enabled: true + hosts: + - documentation-api.test.market.local From d37009acaaadbcda7fd008828b4e8e50802781e0 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:10:54 +0300 Subject: [PATCH 06/18] EVOADMIN-481 Add namespace --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1fce8f2..30caea3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { } stage('Deploy') { steps { - kubeRolloutWithHelm('test-cluster', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "$BUILD_TAG") + kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "$BUILD_TAG") } } } From 8a1a015133374337a8096b4532b5c9a4c7e240bd Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:18:06 +0300 Subject: [PATCH 07/18] EVOADMIN-481 Remove commas --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 30caea3..bb2d0ac 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { } stage('Deploy') { steps { - kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "$BUILD_TAG") + kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', $BUILD_TAG) } } } From 03ef9181376edb606df03179f7018deca0cbf025 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:20:35 +0300 Subject: [PATCH 08/18] EVOADMIN-481 Debug --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bb2d0ac..5e1c126 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { } stage('Deploy') { steps { - kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', $BUILD_TAG) + kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', ${BUILD_TAG}) } } } From 081dfc17608c4d1a38ab5f9e5a041faaefc68fc6 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:21:19 +0300 Subject: [PATCH 09/18] EVOADMIN-481 Debug --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5e1c126..8b67024 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { } stage('Deploy') { steps { - kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', ${BUILD_TAG}) + kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "${BUILD_TAG}") } } } From a9636cd2a7e3e91f80af5e551f7ebb4b4fb1c00d Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:30:06 +0300 Subject: [PATCH 10/18] EVOADMIN-481 Debug --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8b67024..67918fa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,9 @@ pipeline { } stage('Deploy') { steps { - kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "${BUILD_TAG}") + // kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "${BUILD_TAG}") + kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") + } } } From 0cff4dd05c5fbcbcf8d298159299d41ff2cd7217 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:33:03 +0300 Subject: [PATCH 11/18] EVOADMIN-481 Debug --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 67918fa..2314b78 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,8 +19,8 @@ pipeline { } stage('Deploy') { steps { - // kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "${BUILD_TAG}") - kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") + kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "${BUILD_TAG}") + // kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") } } From 45e604e04800d8cf17a41dde2f66c6b577095c0a Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:44:39 +0300 Subject: [PATCH 12/18] EVOADMIN-481 Debug --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2314b78..90dc331 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,8 @@ pipeline { } stage('Deploy') { steps { - kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "${BUILD_TAG}") + kubeRolloutWithHelm('test-cluster') + // kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "${BUILD_TAG}") // kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") } From 99211ca53a4705cdd386ab5ce4bc33bd45bc319e Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:48:24 +0300 Subject: [PATCH 13/18] EVOADMIN-481 Debug --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 90dc331..6f30717 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,8 +19,8 @@ pipeline { } stage('Deploy') { steps { - kubeRolloutWithHelm('test-cluster') - // kubeRolloutWithHelm('test-cluster', 'test', 'documentation-api', './helm/documentation-api', './helm/values/test.yaml', "${BUILD_TAG}") + // kubeRolloutWithHelm('test-cluster') + kubeRolloutWithHelm('test-cluster', 'test', './helm/values/test.yaml', "${BUILD_TAG}", 'documentation-api', './helm/documentation-api') // kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") } From d11d1ed313350cb8faf1ad39b482f1d9ab04b507 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:56:44 +0300 Subject: [PATCH 14/18] EVOADMIN-481 Debug --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f30717..4b5b0ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { stage('Deploy') { steps { // kubeRolloutWithHelm('test-cluster') - kubeRolloutWithHelm('test-cluster', 'test', './helm/values/test.yaml', "${BUILD_TAG}", 'documentation-api', './helm/documentation-api') + helmUpgradeInstall('test-cluster', 'test', './helm/values/test.yaml', "${BUILD_TAG}", 'documentation-api', './helm/documentation-api') // kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") } From dcb59c8b0f66d37879c3e4a8559777903cee7f43 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 12:58:35 +0300 Subject: [PATCH 15/18] EVOADMIN-481 Debug --- Jenkinsfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4b5b0ed..6395cd4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,15 +19,12 @@ pipeline { } stage('Deploy') { steps { - // kubeRolloutWithHelm('test-cluster') helmUpgradeInstall('test-cluster', 'test', './helm/values/test.yaml', "${BUILD_TAG}", 'documentation-api', './helm/documentation-api') - // kubeRollout('test', 'deployment', 'documentation-api', "docker-registry.market.local/documentation-api:$BUILD_TAG") - } } } - post { - always { + post { + failure { reportToTelegram() } } From 4c49896878194276eb02daf4cb23f0f4c0a4a9af Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 13:03:59 +0300 Subject: [PATCH 16/18] EVOADMIN-481 Debug --- Jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6395cd4..8a9c29b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,17 +9,18 @@ pipeline { stages { stage('Build') { steps { - sh "docker build -t docker-registry.market.local/documentation-api:$BUILD_TAG ." + populateRevision() + sh "docker build -t docker-registry.market.local/documentation-api:$REVISION ." } } stage('Publish') { steps { - sh "docker push docker-registry.market.local/documentation-api:$BUILD_TAG" + sh "docker push docker-registry.market.local/documentation-api:$REVISION" } } stage('Deploy') { steps { - helmUpgradeInstall('test-cluster', 'test', './helm/values/test.yaml', "${BUILD_TAG}", 'documentation-api', './helm/documentation-api') + helmUpgradeInstall('test-cluster', 'test', './helm/values/test.yaml', "${REVISION}", 'documentation-api', './helm/documentation-api') } } } From 781470b98e5353d0c71e3b1aa098d6f04637f221 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 13:09:53 +0300 Subject: [PATCH 17/18] EVOADMIN-481 Deploy only if master or dev branch --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8a9c29b..a25a5dd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,11 @@ pipeline { } stage('Deploy') { steps { - helmUpgradeInstall('test-cluster', 'test', './helm/values/test.yaml', "${REVISION}", 'documentation-api', './helm/documentation-api') + if (env.BRANCH_NAME == 'dev') { + helmUpgradeInstall('test-cluster', 'test', './helm/values/test.yaml', "${REVISION}", 'documentation-api', './helm/documentation-api') + } else if (env.BRANCH_NAME == 'master') { + helmUpgradeInstall('prod-cluster', 'prod', './helm/values/prod.yaml', "${REVISION}", 'documentation-api', './helm/documentation-api') + } } } } From 3a2efc2e8cde9384c9703fb5a99dad0f748b7dd5 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 12 Dec 2017 13:28:09 +0300 Subject: [PATCH 18/18] EVOADMIN-481 Change some things --- Jenkinsfile | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a25a5dd..8aae5b5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,23 +8,45 @@ pipeline { } stages { stage('Build') { + when { + anyOf { + branch 'master' + branch 'dev' + } + } steps { populateRevision() sh "docker build -t docker-registry.market.local/documentation-api:$REVISION ." } } + stage('Publish') { + when { + anyOf { + branch 'master' + branch 'dev' + } + } steps { sh "docker push docker-registry.market.local/documentation-api:$REVISION" } } - stage('Deploy') { + + stage('Deploy to Test cluster') { + when { + branch 'dev' + } + steps { + helmUpgradeInstall('test-cluster', 'test', './helm/values/test.yaml', "${REVISION}", 'documentation-api', './helm/documentation-api') + } + } + + stage('Deploy to Prod cluster') { + when { + branch 'master' + } steps { - if (env.BRANCH_NAME == 'dev') { - helmUpgradeInstall('test-cluster', 'test', './helm/values/test.yaml', "${REVISION}", 'documentation-api', './helm/documentation-api') - } else if (env.BRANCH_NAME == 'master') { - helmUpgradeInstall('prod-cluster', 'prod', './helm/values/prod.yaml', "${REVISION}", 'documentation-api', './helm/documentation-api') - } + helmUpgradeInstall('prod-cluster', 'prod', './helm/values/prod.yaml', "${REVISION}", 'documentation-api', './helm/documentation-api') } } }