Skip to content
Snippets Groups Projects
Verified Commit 347c8e9a authored by David Hoese's avatar David Hoese
Browse files

Add really basic attempt at enabling postgis extension on postgres db

parent 3666cc81
No related merge requests found
persistence:
enabled: false
\ No newline at end of file
......@@ -17,6 +17,11 @@ else
release_prefix="$2"
fi
get_pod_name() {
release_name="$1"
kubectl -n $ns get pods --selector=app.kubernetes.io/instance=${release_name} -o name
}
ns=$(./helpers/get_namespace.sh)
# get password from any previous installation
......@@ -41,4 +46,18 @@ echo "Start waiting for postgres: $(date +%Y%m%dT%H%M%S)"
kubectl wait -n $ns --selector=app.kubernetes.io/instance=${release_name} --timeout 120s --for=condition=Ready pod
status=$?
echo "Done waiting for postgis: $(date +%Y%m%dT%H%M%S) : $status"
if [[ ${status} -ne 0 ]]; then
exit $status
fi
# This is the first time we've installed this
if [[ "$sec_info" == "" ]]; then
# Enable PostGIS extension
POSTGRES_PASSWORD=$(kubectl get secret -n $ns ${auth_sec} -o jsonpath-"{.data.postgresql-password}" | base64 --decode)
pod_name=$(get_pod_name ${release_name})
kubectl exec -n $ns ${pod_name} -- bash -c "PGPASSWORD=$POSTGRES_PASSWORD; psql -U postgres -d postgres -c 'CREATE EXTENSION postgis;'"
status=$?
fi
exit $status
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment