Skip to content

Commit

Permalink
apps sc & wc: improve dry-run and apply
Browse files Browse the repository at this point in the history
  • Loading branch information
robinelastisys committed May 6, 2021
1 parent 816781a commit dacf6f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions WIP-CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Changed

- The dry-run and appy command now checks against the state of the cluster while ran.
4 changes: 2 additions & 2 deletions bin/dry-run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ if [[ $1 == "sc" ]]; then
log_info "Running helmfile diff on the service cluster"
: "${config[config_file_sc]:?Missing service cluster config file}"

"${here}/ops.bash" helmfile sc diff
"${here}/ops.bash" helmfile sc template | kubectl diff -f -

elif [[ $1 == "wc" ]]; then
log_info "Running helmfile diff on the workload cluster"
: "${config[config_file_wc]:?Missing workload cluster config file}"

"${here}/ops.bash" helmfile wc diff
"${here}/ops.bash" helmfile wc template | kubectl diff -f -
else
log_error "ERROR: unsupported option for dry-run. Supported options are <wc|sc>"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy-sc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ echo "Installing helm charts" >&2
cd "${SCRIPTS_PATH}/../helmfile"
declare -a helmfile_opt_flags
[[ -n "$INTERACTIVE" ]] && helmfile_opt_flags+=("$INTERACTIVE")
helmfile -f . -e service_cluster "${helmfile_opt_flags[@]}" apply --suppress-diff
helmfile -f . -e service_cluster "${helmfile_opt_flags[@]}" sync --suppress-diff

echo "Deploy sc completed!" >&2
2 changes: 1 addition & 1 deletion scripts/deploy-wc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ echo "Installing helm charts" >&2
cd "${SCRIPTS_PATH}/../helmfile"
declare -a helmfile_opt_flags
[[ -n "$INTERACTIVE" ]] && helmfile_opt_flags+=("$INTERACTIVE")
helmfile -f . -e workload_cluster "${helmfile_opt_flags[@]}" apply --suppress-diff
helmfile -f . -e workload_cluster "${helmfile_opt_flags[@]}" sync --suppress-diff

echo "Deploy wc completed!" >&2

0 comments on commit dacf6f7

Please sign in to comment.