|
@@ -149,6 +149,9 @@ function on_exit() {
|
|
|
|
|
|
debug "Cleaning-up temporary file: $tmp_new"
|
|
|
[[ -f $tmp_new ]] && rm "$tmp_new"
|
|
|
|
|
|
debug "Cleaning-up temporary file: $tmp_new_sorted"
|
|
|
[[ -f $tmp_new_sorted ]] && rm "$tmp_new_sorted"
|
|
|
}
|
|
|
trap on_exit EXIT
|
|
|
|
|
@@ -221,6 +224,7 @@ fi
|
|
|
# stored.
|
|
|
tmp_current=$(mktemp)
|
|
|
tmp_new=$(mktemp)
|
|
|
tmp_new_sorted=$(mktemp)
|
|
|
|
|
|
# Process each environment.
|
|
|
for environment in "$config_dir"/*; do
|
|
@@ -247,18 +251,19 @@ for environment in "$config_dir"/*; do
|
|
|
|
|
|
# Deploy the existing requirements file and the new one.
|
|
|
sed -e 's/[[:blank:]]*#.*//' "$req_txt" | grep -v "^$" | sort -u > "$tmp_current"
|
|
|
if ! pip-compile --upgrade --dry-run --no-header --no-annotate --no-index "$req_in" 2>&1 | \
|
|
|
grep -v 'Dry-run' | sed -e 's/[[:blank:]]*#.*//' | grep -v "^$" | \
|
|
|
sort -u > "$tmp_new" ; then
|
|
|
if ! pip-compile --no-header --no-annotate --no-index --output-file "$tmp_new" --upgrade "$req_in" > /dev/null; then
|
|
|
error "Failed while running pip-compile command against (see error stack trace above): $req_in"
|
|
|
continue
|
|
|
fi
|
|
|
|
|
|
# Sort the new requirements file.
|
|
|
sed -e 's/[[:blank:]]*#.*//' "$tmp_new" | grep -v "^$" | sort -u > "$tmp_new_sorted"
|
|
|
|
|
|
debug "Current requirements:\n$(cat "$tmp_current")"
|
|
|
debug "New requirements:\n$(cat "$tmp_new")"
|
|
|
debug "New requirements:\n$(cat "$tmp_new_sorted")"
|
|
|
|
|
|
# Run diff, storing the output and result.
|
|
|
diff=$(diff -u "$tmp_current" "$tmp_new")
|
|
|
diff=$(diff -u "$tmp_current" "$tmp_new_sorted")
|
|
|
result="$?"
|
|
|
|
|
|
# Show warning about available updates.
|