Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geosphere-deploy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cspp_geo
geosphere
geosphere-deploy
Commits
347c8e9a
Verified
Commit
347c8e9a
authored
4 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Add really basic attempt at enabling postgis extension on postgres db
parent
3666cc81
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ci_tests/basic_postgres/values-postgis.yaml
+2
-0
2 additions, 0 deletions
ci_tests/basic_postgres/values-postgis.yaml
helpers/deploy_postgis.sh
+19
-0
19 additions, 0 deletions
helpers/deploy_postgis.sh
with
21 additions
and
0 deletions
ci_tests/basic_postgres/values-postgis.yaml
+
2
−
0
View file @
347c8e9a
persistence
:
enabled
:
false
\ No newline at end of file
This diff is collapsed.
Click to expand it.
helpers/deploy_postgis.sh
+
19
−
0
View file @
347c8e9a
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment