|
@@ -19,8 +19,6 @@ pipeline {
|
|
APP_GIT_URL='ssh://git@git.sdsys.ru:8022/iru/node.git'
|
|
APP_GIT_URL='ssh://git@git.sdsys.ru:8022/iru/node.git'
|
|
JENKINS_MAIL='jenkins.dev@sdsys.ru'
|
|
JENKINS_MAIL='jenkins.dev@sdsys.ru'
|
|
DOCKER_REGISTRY='images.sdsys.ru'
|
|
DOCKER_REGISTRY='images.sdsys.ru'
|
|
- PROJECT=''
|
|
|
|
- CHART_NAME=''
|
|
|
|
CHART_PATH=''
|
|
CHART_PATH=''
|
|
HELM_DIR=''
|
|
HELM_DIR=''
|
|
IMAGE_TO_PUSH=''
|
|
IMAGE_TO_PUSH=''
|
|
@@ -45,9 +43,7 @@ pipeline {
|
|
gitOps.clone(HELM_GIT_URL)
|
|
gitOps.clone(HELM_GIT_URL)
|
|
echo "Defining variables"
|
|
echo "Defining variables"
|
|
HELM_DIR = dirOps.calculateDir(HELM_GIT_URL)
|
|
HELM_DIR = dirOps.calculateDir(HELM_GIT_URL)
|
|
- SUB_PATH = ''
|
|
|
|
CHART_PATH = HELM_DIR + "/helm/" + DOCKER_IMAGE.split("/")[0]
|
|
CHART_PATH = HELM_DIR + "/helm/" + DOCKER_IMAGE.split("/")[0]
|
|
- PROJECT = DOCKER_IMAGE.split("/")[1]
|
|
|
|
VALUES_FILE = "${CHART_PATH}/dev.yaml"
|
|
VALUES_FILE = "${CHART_PATH}/dev.yaml"
|
|
IMAGE_TO_PUSH = "${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${repo}-${BUILD_NUMBER}"
|
|
IMAGE_TO_PUSH = "${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${repo}-${BUILD_NUMBER}"
|
|
}
|
|
}
|
|
@@ -65,7 +61,7 @@ pipeline {
|
|
stage("Update Helm Chart") {
|
|
stage("Update Helm Chart") {
|
|
steps {
|
|
steps {
|
|
script {
|
|
script {
|
|
- TAG_PATH = "images.${PROJECT}"
|
|
|
|
|
|
+ TAG_PATH = "images." + DOCKER_IMAGE.split("/")[1]
|
|
echo "Update ${TAG_PATH} to ${IMAGE_TO_PUSH} in ${VALUES_FILE}"
|
|
echo "Update ${TAG_PATH} to ${IMAGE_TO_PUSH} in ${VALUES_FILE}"
|
|
def data = readYaml file: "${VALUES_FILE}"
|
|
def data = readYaml file: "${VALUES_FILE}"
|
|
yamlOps.updateBuilder(TAG_PATH, data, IMAGE_TO_PUSH)
|
|
yamlOps.updateBuilder(TAG_PATH, data, IMAGE_TO_PUSH)
|
|
@@ -95,6 +91,7 @@ pipeline {
|
|
steps {
|
|
steps {
|
|
script {
|
|
script {
|
|
echo "Push changes to Repo"
|
|
echo "Push changes to Repo"
|
|
|
|
+ PROJECT = DOCKER_IMAGE.split("/")[1]
|
|
COMMIT = "Version update ${PROJECT}"
|
|
COMMIT = "Version update ${PROJECT}"
|
|
gitOps.push(HELM_DIR, COMMIT)
|
|
gitOps.push(HELM_DIR, COMMIT)
|
|
}
|
|
}
|