2021-07-12 20:14:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-09-29 21:08:53 +00:00
|
|
|
set -eu
|
2022-10-21 20:15:34 +00:00
|
|
|
source script/lib/deploy-helpers.sh
|
2021-07-12 20:14:39 +00:00
|
|
|
|
2022-10-19 22:31:47 +00:00
|
|
|
if [[ $# < 2 ]]; then
|
|
|
|
echo "Usage: $0 <production|staging|preview> <tag-name>"
|
2021-09-29 21:08:53 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-10-21 22:50:14 +00:00
|
|
|
environment=$1
|
|
|
|
version=$2
|
2022-10-19 22:31:47 +00:00
|
|
|
|
2022-10-21 22:50:14 +00:00
|
|
|
export_vars_for_environment ${environment}
|
|
|
|
image_id=$(image_id_for_version ${version})
|
|
|
|
|
2023-09-13 04:04:59 +00:00
|
|
|
export ZED_DO_CERTIFICATE_ID=$(doctl compute certificate list --format ID --no-header)
|
2022-10-21 22:50:14 +00:00
|
|
|
export ZED_KUBE_NAMESPACE=${environment}
|
|
|
|
export ZED_IMAGE_ID=${image_id}
|
2021-09-29 21:08:53 +00:00
|
|
|
|
2022-10-21 22:50:14 +00:00
|
|
|
target_zed_kube_cluster
|
2022-04-12 00:18:12 +00:00
|
|
|
envsubst < crates/collab/k8s/manifest.template.yml | kubectl apply -f -
|
2022-10-21 22:50:14 +00:00
|
|
|
|
2023-09-13 04:06:43 +00:00
|
|
|
echo "deployed collab v${version} to ${environment}"
|