Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 7f4318a

Browse files
author
Hans Kristian Flaatten
authored
Add firstEnv option to acePushConfigToGit (#39)
1 parent f2ad613 commit 7f4318a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Diff for: Jenkinsfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!groovy
2-
@Library("ace@rewrite") _
2+
@Library("ace@master") _
33

44
ace([dockerSet: false]) {
55
stage('Lint') {

Diff for: vars/acePushConfigToGit.groovy

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
void call(Map opts = []) {
1+
@SuppressWarnings(['MethodSize'])
2+
void call(Map opts = [:]) {
23
generateAceValues(opts)
34

45
target = readYaml file: 'target-data/target.yaml'
56
cfg = readYaml file: 'ace.yaml'
67
Map gitops = cfg.gitops ?: [:]
78
String gitopsRepo = gitops.repo
8-
String strategy = gitops.strategy ?: "branch"
9+
String strategy = gitops.strategy ?: 'branch'
910

1011
if (!gitopsRepo) {
1112
error('[ace] No gitops repo specified, dying.')
@@ -36,7 +37,7 @@ void call(Map opts = []) {
3637
git fetch -a
3738
"""
3839

39-
if (strategy == "branch") {
40+
if (strategy == 'branch') {
4041
String pushToBranch = gitops.pushToBranch ?: 'test'
4142

4243
String branches = sh(
@@ -69,10 +70,10 @@ void call(Map opts = []) {
6970
git push origin ${pushToBranch}
7071
fi
7172
"""
72-
} else if (strategy == "path") {
73+
} else if (strategy == 'path') {
7374
String pushToBranch = gitops.pushToBranch ?: 'master'
7475

75-
String firstEnv = gitops.firstEnv ?: "test"
76+
String firstEnv = opts.firstEnv ?: gitops.firstEnv ?: 'test'
7677
String targetFolder = "${target.name}/${firstEnv}"
7778

7879
sh """

0 commit comments

Comments
 (0)