2021-07-12 23:14:39 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-09-30 00:08:53 +03:00
|
|
|
set -eu
|
2022-10-21 23:15:34 +03:00
|
|
|
source script/lib/deploy-helpers.sh
|
2021-09-30 00:08:53 +03:00
|
|
|
|
2022-10-21 23:15:34 +03:00
|
|
|
if [[ $# < 2 ]]; then
|
|
|
|
echo "Usage: $0 <production|staging|preview> <tag-name>"
|
2021-09-30 00:08:53 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
export ZED_KUBE_NAMESPACE=$1
|
2022-10-21 23:15:34 +03:00
|
|
|
COLLAB_VERSION=$2
|
2021-09-30 00:08:53 +03:00
|
|
|
|
2022-10-21 23:15:34 +03:00
|
|
|
export_vars_for_environment $ZED_KUBE_NAMESPACE
|
|
|
|
export ZED_IMAGE_ID=$(image_id_for_version ${COLLAB_VERSION})
|
|
|
|
export ZED_MIGRATE_JOB_NAME=zed-migrate-${COLLAB_VERSION}
|
|
|
|
target_zed_kube_cluster
|
2021-09-30 00:08:53 +03:00
|
|
|
|
2022-04-21 20:01:02 +03:00
|
|
|
envsubst < crates/collab/k8s/migrate.template.yml | kubectl apply -f -
|
2021-09-30 00:08:53 +03:00
|
|
|
pod=$(kubectl --namespace=${ZED_KUBE_NAMESPACE} get pods --selector=job-name=${ZED_MIGRATE_JOB_NAME} --output=jsonpath='{.items[*].metadata.name}')
|
|
|
|
echo "pod:" $pod
|