1#!/usr/bin/env 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
12export_vars_for_environment ${environment}
13
14export ZED_DO_CERTIFICATE_ID=$(doctl compute certificate list --format ID --no-header)
15export ZED_KUBE_NAMESPACE=${environment}
16
17target_zed_kube_cluster
18envsubst < crates/collab/k8s/postgrest.template.yml | kubectl apply -f -
19
20echo "deployed postgrest"