2022-10-22 00:25:12 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
source script/lib/deploy-helpers.sh
|
|
|
|
|
|
|
|
if [[ $# < 1 ]]; then
|
2024-01-11 22:24:17 +03:00
|
|
|
echo "Usage: $0 <production|preview|nightly|staging>"
|
2022-10-22 00:25:12 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-10-22 01:50:14 +03:00
|
|
|
environment=$1
|
2022-10-22 00:25:12 +03:00
|
|
|
|
2022-10-22 01:50:14 +03:00
|
|
|
export_vars_for_environment ${environment}
|
2022-10-22 00:25:12 +03:00
|
|
|
target_zed_kube_cluster
|
|
|
|
|
2022-10-22 01:50:14 +03:00
|
|
|
deployed_image_id=$(
|
|
|
|
kubectl \
|
|
|
|
--namespace=${environment} \
|
|
|
|
get deployment collab \
|
|
|
|
-o 'jsonpath={.spec.template.spec.containers[0].image}' \
|
|
|
|
| cut -d: -f2
|
|
|
|
)
|
2022-10-22 00:25:12 +03:00
|
|
|
|
2022-10-22 01:50:14 +03:00
|
|
|
job_image_ids=$(
|
|
|
|
kubectl \
|
|
|
|
--namespace=${environment} \
|
|
|
|
get jobs \
|
2022-11-02 22:05:37 +03:00
|
|
|
-o 'jsonpath={range .items[0:5]}{.spec.template.spec.containers[0].image}{"\n"}{end}' \
|
|
|
|
2> /dev/null \
|
|
|
|
|| true
|
2022-10-22 01:50:14 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
echo "Deployed image version:"
|
|
|
|
echo "$deployed_image_id"
|
|
|
|
echo
|
|
|
|
echo "Migration job image versions:"
|
|
|
|
echo "$job_image_ids"
|
|
|
|
echo
|