1#!/bin/bash
2
3set -eu
4source script/lib/deploy-helpers.sh
5
6if [[ $# < 1 ]]; then
7 echo "Usage: $0 <production|staging> (postgrest not needed on preview or nightly)"
8 exit 1
9fi
10environment=$1
11
12if [[ ${environment} == "preview" || ${environment} == "nightly" ]]; then
13 echo "website does not exist in preview or nightly"
14 exit 1
15fi
16
17export_vars_for_environment ${environment}
18
19export ZED_DO_CERTIFICATE_ID=$(doctl compute certificate list --format ID --no-header)
20export ZED_KUBE_NAMESPACE=${environment}
21
22target_zed_kube_cluster
23envsubst < crates/collab/k8s/postgrest.template.yml | kubectl apply -f -
24
25echo "deployed postgrest"