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-07-12 23:14:39 +03:00
|
|
|
|
2022-10-20 01:31:47 +03:00
|
|
|
if [[ $# < 2 ]]; then
|
2023-11-17 21:31:10 +03:00
|
|
|
echo "Usage: $0 <production|staging|preview> <tag-name> (nightly is not yet supported)"
|
2021-09-30 00:08:53 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-10-22 01:50:14 +03:00
|
|
|
environment=$1
|
|
|
|
version=$2
|
2022-10-20 01:31:47 +03:00
|
|
|
|
2022-10-22 01:50:14 +03:00
|
|
|
export_vars_for_environment ${environment}
|
|
|
|
image_id=$(image_id_for_version ${version})
|
|
|
|
|
2023-09-13 07:04:59 +03:00
|
|
|
export ZED_DO_CERTIFICATE_ID=$(doctl compute certificate list --format ID --no-header)
|
2022-10-22 01:50:14 +03:00
|
|
|
export ZED_KUBE_NAMESPACE=${environment}
|
|
|
|
export ZED_IMAGE_ID=${image_id}
|
2021-09-30 00:08:53 +03:00
|
|
|
|
2022-10-22 01:50:14 +03:00
|
|
|
target_zed_kube_cluster
|
2024-01-03 01:05:31 +03:00
|
|
|
envsubst < crates/collab/k8s/collab.template.yml | kubectl apply -f -
|
2022-10-22 01:50:14 +03:00
|
|
|
|
2023-09-13 07:06:43 +03:00
|
|
|
echo "deployed collab v${version} to ${environment}"
|