Skip to content
Snippets Groups Projects
Commit 2f567201 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3140 check before git commit

parent ee5a0c7d
Branches
Tags
No related merge requests found
......@@ -251,10 +251,6 @@ Void setNewProvisioningVersion(String environment) {
dir("provisioning") {
def envFile = "inventories/group_vars/${environment}/versions"
if (env.BRANCH_NAME == 'release') {
envFile = "playbook/inventory/versions/${environment}.yml"
}
def envVersions = readYaml file: envFile
envVersions.versions.user_manager.image.tag = IMAGE_TAG
......@@ -277,14 +273,14 @@ Void checkoutProvisioningRepo() {
}
Void pushNewProvisioningVersion(String environment) {
withCredentials([usernamePassword(credentialsId: 'jenkins-gitea-access-token', passwordVariable: 'TOKEN', usernameVariable: 'USER')]) {
dir('provisioning') {
if (env.BRANCH_NAME == 'release') {
sh 'git add playbook/inventory/versions/.'
if (sh (script: "git status | grep 'inventories/group_vars/.*/versions'", returnStatus: true) == 1) {
return
}
else {
withCredentials([usernamePassword(credentialsId: 'jenkins-gitea-access-token', passwordVariable: 'TOKEN', usernameVariable: 'USER')]) {
sh 'git add inventories/group_vars/*/versions'
}
sh 'git config user.email "jenkins@ozg.de"'
sh 'git config user.name "jenkins"'
sh "git commit -m 'jenkins rollout ${environment} user-manager version ${IMAGE_TAG}'"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment