Skip to content
Snippets Groups Projects
Commit 311eb65c authored by OZG-Cloud Team's avatar OZG-Cloud Team
Browse files

Merge pull request 'OZG-3140-git-push-check' (#20) from OZG-3140-git-push-check into master

parents ac64f870 6f385c6c
No related branches found
No related tags found
No related merge requests found
......@@ -241,11 +241,6 @@ String getElementAccessToken() {
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.afm_adapter.image.tag = IMAGE_TAG
......@@ -258,14 +253,14 @@ Void setNewProvisioningVersion(String environment) {
}
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} afm-adapter fs-adapter version ${IMAGE_TAG}'"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment