-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from cubasepp/postgres-client-version
Allow to specify postgres-client-version
- Loading branch information
Showing
2 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
apt-get update -y && apt-get -y install --no-install-recommends libpq-dev postgresql-client | ||
export POSTGRES_CLIENT_VERSION="${VERSION:-"15"}" | ||
|
||
apt-get update -qq | ||
|
||
VERSION_EXISTS=$(apt-cache search --names-only postgresql-client-$POSTGRES_CLIENT_VERSION | wc -l) | ||
|
||
if [ "$VERSION_EXISTS" -ge 1 ]; then | ||
apt-get install --no-install-recommends -y postgresql-client-$POSTGRES_CLIENT_VERSION | ||
else | ||
apt-get install --no-install-recommends -y postgresql-common | ||
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && apt-get install --no-install-recommends -y postgresql-client-$POSTGRES_CLIENT_VERSION | ||
fi | ||
|
||
rm -rf /var/lib/apt/lists/* |