Skip to content
Snippets Groups Projects
Commit 884c6dbe authored by OZGCloud's avatar OZGCloud
Browse files

ozg-2502 ansible refactoring

parent 7a49b0f0
Branches
Tags
No related merge requests found
......@@ -638,7 +638,11 @@ Void initHelmRepo() {
Void setNewGoofyProvisioningVersion(String environment) {
dir("provisioning") {
def envFile = "playbook/inventory/versions/${environment}.yml"
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
......@@ -650,7 +654,12 @@ Void setNewGoofyProvisioningVersion(String environment) {
Void pushNewProvisioningVersion(String environment) {
withCredentials([usernamePassword(credentialsId: 'jenkins-gitea-access-token', passwordVariable: 'TOKEN', usernameVariable: 'USER')]) {
dir('provisioning') {
sh 'git add playbook/inventory/versions/.'
if (env.BRANCH_NAME == 'release') {
sh 'git add playbook/inventory/versions/.'
}
else {
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