feature: initial commit for all new image changes

This commit is contained in:
Subir Ghosh
2024-11-13 17:16:01 -07:00
parent de6aa9e70e
commit fcf3d0ac96
1042 changed files with 45086 additions and 1 deletions
@@ -0,0 +1,37 @@
#!/bin/bash -e
################################################################################
## File: install-postgresql.sh
## Desc: Install PostgreSQL
################################################################################
# Source the helpers
source $HELPER_SCRIPTS/os.sh
source $HELPER_SCRIPTS/install.sh
REPO_URL="https://apt.postgresql.org/pub/repos/apt/"
# Preparing repo for PostgreSQL
wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /usr/share/keyrings/postgresql.gpg
echo "deb [signed-by=/usr/share/keyrings/postgresql.gpg] $REPO_URL $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
# Fetch PostgreSQL version to install from the toolset
toolset_version=$(get_toolset_value '.postgresql.version')
# Install PostgreSQL
echo "Install PostgreSQL"
apt update
apt-get install postgresql-$toolset_version
echo "Install libpq-dev"
apt-get install libpq-dev
# Disable postgresql.service
systemctl is-active --quiet postgresql.service && systemctl stop postgresql.service
systemctl disable postgresql.service
rm /etc/apt/sources.list.d/pgdg.list
rm /usr/share/keyrings/postgresql.gpg
echo "postgresql $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
invoke_tests "Databases" "PostgreSQL"