Skip to content

Commit

Permalink
feature/chartValues (#52)
Browse files Browse the repository at this point in the history
pull chart with correct values. #minor
  • Loading branch information
bjorges committed Apr 30, 2021
1 parent d6d5e49 commit 6d97825
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vars/acePushConfigToGit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void call(Map opts = [:]) {

print "[ace] gitops repo strategy is ${strategy}"

helmPullChart(target.chart, opts)
helmPullChart(target, opts)

withCredentials([usernamePassword(
credentialsId: 'jenkins-git',
Expand Down
14 changes: 11 additions & 3 deletions vars/helmPullChart.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
void call(String chart, Map opts = [:]) {
void call(Map target, Map opts = [:]) {
Map containers = opts.containers ?: [:]
String helmContainer = containers.helm ?: ''
List<String> helmOpts = opts.helmOpts ?: ["--entrypoint=''"]
String chart = target.chart
String repo = target.repo ?: https://evry-ace.github.io/helm-charts
String repoName = target.repoName ?: ace
String version = target.version ?: ''

if (!chart) {
error('[ace] No chart specified, dying.')
}

println "[ace] - Got containers - ${containers}"

Expand All @@ -18,10 +26,10 @@ void call(String chart, Map opts = [:]) {
export XDG_CACHE_HOME=\$HELM_HOME/cache
export XDG_CONFIG_HOME=\$HELM_HOME/config
export XDG_data_HOME=\$HELM_HOME/data
helm repo add ace https://evry-ace.github.io/helm-charts
helm repo add ${repoName} ${repo}
helm repo update
helm pull ${chart} --untar -d chart
helm pull ${chart} --version "${version}" --untar -d chart
mv chart/${chart.split('/')[1]}/* target-data
"""
}
Expand Down

0 comments on commit 6d97825

Please sign in to comment.