Skip to content
Snippets Groups Projects
Commit 64b93e29 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5953 clean up jenkinsfile.storybook

parent bf0ae46b
Branches
Tags
No related merge requests found
......@@ -11,6 +11,7 @@ pipeline {
SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/
FAILED_STAGE = ""
SH_SUCCESS_STATUS_CODE = 0
}
options {
......@@ -71,6 +72,8 @@ pipeline {
stage('Test, build and deploy Helm Chart') {
steps {
script {
HELM_CHART_VERSION = generateHelmChartVersion()
dir('alfa-client/libs/design-system') {
sh "./run_helm_test.sh"
}
......@@ -95,7 +98,7 @@ pipeline {
cloneGitopsRepo()
setNewDevVersion()
setNewGitopsVersion()
pushGitopsRepo()
}
}
......@@ -142,17 +145,11 @@ Void configureGit() {
}
}
Void setNewDevVersion() {
setNewGitopsVersion("dev")
}
Void setNewTestVersion() {
setNewGitopsVersion("test")
}
Void setNewGitopsVersion(String environment) {
Void setNewGitopsVersion() {
dir("gitops") {
def envFile = "${environment}/application/values/storybook-values.yaml"
def envFile = "dev/application/values/storybook-values.yaml"
def envVersions = readYaml file: envFile
......@@ -161,15 +158,15 @@ Void setNewGitopsVersion(String environment) {
writeYaml file: envFile, data: envVersions, overwrite: true
if (hasValuesFileChanged(environment)) {
if (hasValuesFileChanged()) {
sh "git add ${envFile}"
sh "git commit -m 'jenkins rollout ${environment} storybook version ${IMAGE_TAG}'"
sh "git commit -m 'jenkins rollout dev storybook version ${IMAGE_TAG}'"
}
}
}
Boolean hasValuesFileChanged(String environment) {
return sh (script: "git status | grep '${environment}/application/values/storybook-values.yaml'", returnStatus: true) == env.SH_SUCCESS_STATUS_CODE as Integer
Boolean hasValuesFileChanged() {
return sh (script: "git status | grep 'dev/application/values/storybook-values.yaml'", returnStatus: true) == env.SH_SUCCESS_STATUS_CODE as Integer
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment