Compare commits

...

23 Commits

Author SHA1 Message Date
Michelle Ark
d2219090ee Install-Binary 2024-09-10 18:47:44 -04:00
Michelle Ark
6393007bd8 set PG_LIBDIR 2024-09-10 18:26:46 -04:00
Michelle Ark
7cd01947e0 export env vars 2024-09-10 18:20:03 -04:00
Michelle Ark
6cceaefa23 choco install + set pg env vars manually 2024-09-10 18:14:07 -04:00
Michelle Ark
75acd4eca1 choco install + set pg env vars manually 2024-09-10 18:09:52 -04:00
Michelle Ark
ad7c099348 choco upgrade 2024-09-10 17:55:48 -04:00
Michelle Ark
25a7c4146e don't set PG_BINDIR and PG_LIBDIR 2024-09-10 17:52:14 -04:00
Michelle Ark
611a8e5327 get-service postgres 16 2024-09-10 17:48:09 -04:00
Michelle Ark
346a72c9f8 more bash 2024-09-10 17:39:51 -04:00
Michelle Ark
75bbc4be3a separate bash step 2024-09-10 17:27:36 -04:00
Michelle Ark
6a2ff56aab bash 2024-09-10 17:25:52 -04:00
Michelle Ark
cd9123ff7d try storing expression result in Out-String 2024-09-10 17:18:03 -04:00
Michelle Ark
6fb14cfd28 invoke expression 2024-09-10 17:12:09 -04:00
Michelle Ark
2ae2f96d99 pwsh set env variable 2024-09-10 17:02:27 -04:00
Michelle Ark
f5878a5748 one liner 2024-09-10 16:53:49 -04:00
Michelle Ark
508b45bd76 choco install postgres16 on windows 2024-09-10 16:50:13 -04:00
Michelle Ark
7bc9a222e3 remove psql --version check 2024-09-10 16:37:22 -04:00
Michelle Ark
db675a9274 get postgres version from select 2024-09-10 16:17:48 -04:00
Michelle Ark
6d4b50a0d1 try removing postgres@14 before installing 16 2024-09-10 16:13:59 -04:00
Michelle Ark
06a3a4a287 put back install postgresql postgresql-contrib 2024-09-10 16:11:11 -04:00
Michelle Ark
b4d25fd21a debugging postgres services 2024-09-10 16:02:24 -04:00
Michelle Ark
e79e981c13 start postgresql@16 2024-09-10 15:50:49 -04:00
Michelle Ark
dda6714994 install postgres-16 on linux + macos 2024-09-10 15:14:17 -04:00
4 changed files with 44 additions and 2 deletions

View File

@@ -5,6 +5,15 @@ runs:
steps:
- shell: bash
run: |
sudo systemctl start postgresql.service
sudo apt-get --purge remove postgresql postgresql-*
sudo apt update -y
sudo apt install gnupg2 wget vim -y
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
sudo apt update -y
sudo apt install postgresql-16
sudo apt-get -y install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo systemctl enable postgresql
pg_isready
sudo -u postgres bash ${{ github.action_path }}/setup_db.sh

View File

@@ -5,7 +5,8 @@ runs:
steps:
- shell: bash
run: |
brew services start postgresql
brew install postgresql@16
brew services start postgresql@16
echo "Check PostgreSQL service is running"
i=10
COMMAND='pg_isready'

View File

@@ -5,6 +5,37 @@ runs:
steps:
- shell: pwsh
run: |
# Download postgres16
$url = "https://get.enterprisedb.com/postgresql/postgresql-16.1-1-windows-x64.exe"
$checkAccess = [System.Net.WebRequest]::Create($url)
$response = $checkAccess.GetResponse()
$installerUrl = $response.ResponseUri.OriginalString
# Invoke Install-Binary function
$installerArgs = @("--install_runtimes 0", "--superpassword root", "--enable_acledit 1", "--unattendedmodeui none", "--mode unattended")
Install-Binary `
-Url $url `
-InstallArgs $installerArgs `
-ExpectedSignature (Get-ToolsetContent).postgresql.signature
# Get Path to pg_ctl.exe
$pgPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName
# Parse output of command above to obtain pure path
$pgBin = Split-Path -Path $pgPath.split('"')[1]
$pgRoot = Split-Path -Path $pgPath.split('"')[5]
$pgData = Join-Path $pgRoot "data"
# Validate PostgreSQL installation
$pgReadyPath = Join-Path $pgBin "pg_isready.exe"
$pgReady = Start-Process -FilePath $pgReadyPath -Wait -PassThru
$exitCode = $pgReady.ExitCode
if ($exitCode -ne 0) {
Write-Host -Object "PostgreSQL is not ready. Exitcode: $exitCode"
exit $exitCode
}
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru

View File

@@ -39,6 +39,7 @@ for i in {1..10}; do
done;
createdb dbt
psql -c "SELECT version();"
psql -c "CREATE ROLE root WITH PASSWORD 'password';"
psql -c "ALTER ROLE root WITH LOGIN;"
psql -c "GRANT CREATE, CONNECT ON DATABASE dbt TO root WITH GRANT OPTION;"