finance-dbt/Deploy.sh
沈楠 fed01c723e
All checks were successful
MJN/finance-dbt/pipeline/head This commit looks good
use sed instead of envsubst
2024-04-12 18:51:43 +08:00

22 lines
614 B
Bash

if [ -z "$deployment" ]; then
echo "deployment is not set"
exit 1
fi
if [ -z "$namespace" ]; then
echo "namespace is not set"
exit 1
fi
if [ -z "$image_tag" ]; then
echo "image_tag is not set"
exit 1
fi
if [ "$deployment" = "dev" ] || [ "$deployment" = "test" ] ; then
export ingress_host=finance-dbt-doc.${deployment}.mujiannan.com
else
export ingress_host=finance-dbt-doc.mujiannan.com
fi
sed -e "s/\${namespace}/${namespace}/g" Deploy.yml \
-e "s/\${deployment}/${deployment}/g" \
-e "s/\${image_tag}/${image_tag}/g" \
-e "s/\${ingress_host}/${ingress_host}/g" \
| kubectl apply -f -