Skip to content
Snippets Groups Projects
Commit 5505e29e authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3140 check before git commit

parent 3998b852
No related branches found
No related tags found
No related merge requests found
......@@ -442,11 +442,6 @@ Void copyTestEnvironmentToDev(stage) {
def devEnvFile = "inventories/group_vars/dev/versions"
def testEnvFile = "inventories/group_vars/test/versions"
if (env.BRANCH_NAME == 'release') {
devEnvFile = "playbook/inventory/versions/dev.yml"
testEnvFile = "playbook/inventory/versions/test.yml"
}
def devVersions = readYaml file: devEnvFile
def testVersions = readYaml file: testEnvFile
......@@ -461,10 +456,6 @@ Void editEnvironemntVersion(String stage, String imageTag, Boolean isEa, String
dir("${stage}/provisioning") {
def editFile = "inventories/group_vars/dev/versions"
if (env.BRANCH_NAME == 'release') {
editFile = "playbook/inventory/versions/dev.yml"
}
def devVersions = readYaml file: editFile
overrideSpringProfiles = getSpringProfile(isEa)
......@@ -491,10 +482,6 @@ Void setupEaEnvironment(String stage) {
dir("${stage}/provisioning") {
def editFile = "inventories/group_vars/all/env"
if (env.BRANCH_NAME == 'release') {
editFile = "playbook/inventory/group_vars/all.yml"
}
def groupVars = readYaml file: editFile
groupVars.kop_einheitlicher_ansprechpartner = true
......@@ -507,10 +494,6 @@ Void setPlutoDatabasePassword(String stage) {
dir("${stage}/provisioning") {
def editFile = "inventories/group_vars/dev/versions"
if (env.BRANCH_NAME == 'release') {
editFile = "playbook/inventory/versions/dev.yml"
}
def devVars = readYaml file: editFile
devVars.values.pluto.database.password = "XnHhfznNWg65NNd"
......@@ -783,9 +766,6 @@ Void setNewGoofyProvisioningVersion(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.goofy.image.tag = IMAGE_TAG
......@@ -796,14 +776,14 @@ Void setNewGoofyProvisioningVersion(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/.'
}
else {
sh 'git add inventories/group_vars/*/versions'
}
dir('provisioning') {
if (sh (script: "git status | grep 'inventories/group_vars/.*/versions'", returnStatus: true) == 1) {
return
}
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} goofy version ${IMAGE_TAG}'"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment