diff options
author | Alexis de Talhouƫt <alexis.de_talhouet@bell.ca> | 2018-10-18 20:46:40 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-10-18 20:46:40 +0000 |
commit | 040f5c09628d5fb76ac7c9421f8ab73007ded570 (patch) | |
tree | 0453d3eb76f97ecdff73c46c284a0e1d7fc0d046 /kubernetes/helm/plugins/deploy/deploy.sh | |
parent | 357ba2e940cc851b9d3555e88dd784405cbcbc5d (diff) | |
parent | dc8690ee3b0aca0c1b3b6fef8f0740f637b5c43a (diff) |
Merge "Fix deploy when subcharts contain same name"
Diffstat (limited to 'kubernetes/helm/plugins/deploy/deploy.sh')
-rwxr-xr-x | kubernetes/helm/plugins/deploy/deploy.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/kubernetes/helm/plugins/deploy/deploy.sh b/kubernetes/helm/plugins/deploy/deploy.sh index 41873b97e2..9d9d1d208c 100755 --- a/kubernetes/helm/plugins/deploy/deploy.sh +++ b/kubernetes/helm/plugins/deploy/deploy.sh @@ -67,11 +67,11 @@ generate_overrides() { if [[ $START == "global:" ]]; then echo "global:" > $GLOBAL_OVERRIDES cat $COMPUTED_OVERRIDES | sed '/common:/,/consul:/d' \ - | sed -n '/'"$START"'/,/'log:'/p' | sed '1d;$d' >> $GLOBAL_OVERRIDES + | sed -n '/'"$START"'/,/'log:'/p' | sed '1d;$d' >> $GLOBAL_OVERRIDES else SUBCHART_DIR="$CACHE_SUBCHART_DIR/$(cut -d':' -f1 <<<"$START")" if [[ -d "$SUBCHART_DIR" ]]; then - cat $COMPUTED_OVERRIDES | sed -n '/'"$START"'/,/'"$END"'/p' \ + cat $COMPUTED_OVERRIDES | sed -n '/^'"$START"'/,/^'"$END"'/p' \ | sed '1d;$d' | cut -c3- > $SUBCHART_DIR/subchart-overrides.yaml fi fi @@ -122,6 +122,10 @@ deploy() { FLAGS="$(echo $FLAGS| sed -n 's/--verbose//p')" VERBOSE="true" fi + if [[ $FLAGS = *"--dry-run"* ]]; then + VERBOSE="true" + FLAGS="$FLAGS --debug" + fi # should pass all flags instead NAMESPACE="$(echo $FLAGS | sed -n 's/.*\(namespace\).\s*/\1/p' | cut -c10- | cut -d' ' -f1)" @@ -188,10 +192,10 @@ deploy() { helm upgrade -i $RELEASE $CHART_DIR $DEPLOY_FLAGS -f $COMPUTED_OVERRIDES \ > $LOG_FILE.log 2>&1 - echo "release $RELEASE deployed" - if [[ $VERBOSE == "true" ]]; then cat $LOG_FILE + else + echo "release $RELEASE deployed" fi fi @@ -214,10 +218,10 @@ deploy() { $DEPLOY_FLAGS -f $GLOBAL_OVERRIDES -f $SUBCHART_OVERRIDES \ > $LOG_FILE 2>&1 - echo "release ${RELEASE}-${subchart} deployed" - if [[ $VERBOSE == "true" ]]; then cat $LOG_FILE + else + echo "release ${RELEASE}-${subchart} deployed" fi fi else |