Skip to content

Commit 869520b

Browse files
authored
v020725 release (#96)
[+] bump Postgres to v17.5 [+] bump Etcd to v3.5.21 [+] bump Patroni to v4.0.6 [+] bump vip-manager to v4.0.0 [+] bump Python to v3.13.5 [*] move functions from `make.ps1` to `env.ps1`
1 parent e642246 commit 869520b

File tree

6 files changed

+137
-129
lines changed

6 files changed

+137
-129
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/setup-python@v5
1414
with:
15-
python-version: '3.13.1'
15+
python-version: '3.13.5'
1616

1717
- name: Checkout code
1818
uses: actions/checkout@v4

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/setup-python@v5
1414
with:
15-
python-version: '3.13.1'
15+
python-version: '3.13.5'
1616

1717
- name: Check out code
1818
uses: actions/checkout@v4

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
[![Github All Releases](https://img.shields.io/github/downloads/cybertec-postgresql/patroni-windows-packaging/total?style=flat-square)](https://github.com/cybertec-postgresql/patroni-windows-packaging/releases)
44

55
# patroni-windows-packaging
6+
67
Automate installing and launching of Patroni under Windows
78

89
## Install
10+
911
Download the archive from [Releases](https://github.com/cybertec-postgresql/patroni-windows-packaging/releases) page.
1012
To install from zip, please, check the [Setup Guide](doc/setup.md).
1113

1214
## Authors
15+
1316
[Pavlo Golub](https://github.com/pashagolub) and [Julian Markwort](https://github.com/markwort)

env.ps1

Lines changed: 130 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,138 @@
11
$MD = "PES"
22
$VCREDIST_REF = "https://aka.ms/vs/17/release/vc_redist.x64.exe"
3-
$ETCD_REF = "https://github.com/etcd-io/etcd/releases/download/v3.5.18/etcd-v3.5.18-windows-amd64.zip"
4-
$PATRONI_REF = "https://github.com/patroni/patroni/archive/refs/tags/v4.0.5.zip"
3+
$ETCD_REF = "https://github.com/etcd-io/etcd/releases/download/v3.5.21/etcd-v3.5.21-windows-amd64.zip"
4+
$PATRONI_REF = "https://github.com/patroni/patroni/archive/refs/tags/v4.0.6.zip"
55
$MICRO_REF = "https://github.com/zyedidia/micro/releases/download/v2.0.14/micro-2.0.14-win64.zip"
66
$WINSW_REF = "https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW.NET461.exe"
7-
$VIP_REF = "https://github.com/cybertec-postgresql/vip-manager/releases/download/v3.0.0/vip-manager_3.0.0_Windows_x86_64.zip"
8-
$PGSQL_REF = "https://get.enterprisedb.com/postgresql/postgresql-15.12-1-windows-x64-binaries.zip"
9-
$PYTHON_REF = "https://www.python.org/ftp/python/3.13.2/python-3.13.2-amd64.exe"
7+
$VIP_REF = "https://github.com/cybertec-postgresql/vip-manager/releases/download/v4.0.0/vip-manager_4.0.0_Windows_x86_64.zip"
8+
$PGSQL_REF = "https://get.enterprisedb.com/postgresql/postgresql-17.5-1-windows-x64-binaries.zip"
9+
$PYTHON_REF = "https://www.python.org/ftp/python/3.13.5/python-3.13.5-amd64.exe"
1010
# one should change python version in github action workflows when changed here
1111

1212
$SEVENZIP = "C:\Program Files\7-Zip\7z.exe"
1313

14+
function Extract-ZipFile {
15+
param (
16+
[string]$zipFilePath,
17+
[string]$destinationPath
18+
)
19+
if (Test-Path $SEVENZIP) {
20+
& $SEVENZIP x "$zipFilePath" -o"$destinationPath"
21+
Start-Sleep -Seconds 5
22+
}
23+
else {
24+
Expand-Archive -Path "$zipFilePath" -DestinationPath "$destinationPath"
25+
}
26+
Remove-Item -Force "$zipFilePath" -ErrorAction Ignore
27+
}
28+
29+
function Compress-ToZipFile {
30+
param (
31+
[string]$sourcePath,
32+
[string]$destinationPath
33+
)
34+
if (Test-Path $SEVENZIP) {
35+
& $SEVENZIP a "$destinationPath" -y "$sourcePath"
36+
}
37+
else {
38+
Compress-Archive -Path "$sourcePath" -DestinationPath "$destinationPath"
39+
}
40+
}
41+
42+
function Start-Bootstrapping {
43+
Write-Host "`n--- Start bootstrapping ---" -ForegroundColor blue
44+
& ./clean.ps1
45+
New-Item -ItemType Directory -Path $MD
46+
Copy-Item "src\*.bat" $MD
47+
Copy-Item "src\*.ps1" $MD
48+
Copy-Item "doc" "$MD\doc" -Recurse
49+
Write-Host "`n--- End bootstrapping ---" -ForegroundColor green
50+
}
51+
52+
function Get-VCRedist {
53+
Write-Host "`n--- Download VCREDIST ---" -ForegroundColor blue
54+
Invoke-WebRequest -Uri $VCREDIST_REF -OutFile "$MD\vc_redist.x64.exe"
55+
Write-Host "`n--- VCREDIST downloaded ---" -ForegroundColor green
56+
}
57+
58+
function Get-ETCD {
59+
Write-Host "`n--- Download ETCD ---" -ForegroundColor blue
60+
Invoke-WebRequest -Uri $ETCD_REF -OutFile "$env:TEMP\etcd.zip"
61+
Extract-ZipFile "$env:TEMP\etcd.zip" "$MD"
62+
Rename-Item "$MD\etcd-*" "etcd"
63+
Copy-Item "src\etcd.yaml" "$MD\etcd"
64+
Write-Host "`n--- ETCD downloaded ---" -ForegroundColor green
65+
}
66+
67+
function Get-Micro {
68+
Write-Host "`n--- Download MICRO ---" -ForegroundColor blue
69+
Invoke-WebRequest -Uri $MICRO_REF -OutFile "$env:TEMP\micro.zip"
70+
Extract-ZipFile "$env:TEMP\micro.zip" "$MD"
71+
Rename-Item "$MD\micro-*" "micro"
72+
Write-Host "`n--- MICRO downloaded ---" -ForegroundColor green
73+
}
74+
75+
function Get-VIPManager {
76+
Write-Host "`n--- Download VIP-MANAGER ---" -ForegroundColor blue
77+
Invoke-WebRequest -Uri $VIP_REF -OutFile "$env:TEMP\vip.zip"
78+
Extract-ZipFile "$env:TEMP\vip.zip" "$MD"
79+
Rename-Item "$MD\vip-manager*" "vip-manager"
80+
Remove-Item "$MD\vip-manager\*.yml" -ErrorAction Ignore
81+
Copy-Item "src\vip.yaml" "$MD\vip-manager"
82+
Write-Host "`n--- VIP-MANAGER downloaded ---" -ForegroundColor green
83+
}
84+
85+
function Get-PostgreSQL {
86+
Write-Host "`n--- Download POSTGRESQL ---" -ForegroundColor blue
87+
# Example: prompt for credentials if not already set
88+
if (-not $PGSQL_CREDENTIAL) {
89+
$global:PGSQL_CREDENTIAL = Get-Credential -Message "Enter credentials for PostgreSQL download"
90+
}
91+
Invoke-WebRequest -Uri $PGSQL_REF -OutFile "$env:TEMP\pgsql.zip" -Credential $PGSQL_CREDENTIAL
92+
Extract-ZipFile "$env:TEMP\pgsql.zip" "$MD"
93+
Remove-Item -Recurse -Force "$MD\pgsql\pgAdmin 4", "$MD\pgsql\symbols" -ErrorAction Ignore
94+
Write-Host "`n--- POSTGRESQL downloaded ---" -ForegroundColor green
95+
}
96+
97+
function Get-Patroni {
98+
Write-Host "`n--- Download PATRONI ---" -ForegroundColor blue
99+
Invoke-WebRequest -Uri $PATRONI_REF -OutFile "$env:TEMP\patroni.zip"
100+
Extract-ZipFile "$env:TEMP\patroni.zip" "$MD"
101+
Rename-Item "$MD\patroni-*" "patroni"
102+
Remove-Item "$MD\patroni\postgres?.yml" -ErrorAction Ignore
103+
Copy-Item "src\patroni.yaml" "$MD\patroni"
104+
Write-Host "`n--- PATRONI downloaded ---" -ForegroundColor green
105+
}
106+
107+
function Update-PythonAndPIP {
108+
Write-Host "`n--- Update Python and PIP installation ---" -ForegroundColor blue
109+
& "./install-python.ps1"
110+
Move-Item "python-install.exe" "$MD"
111+
Write-Host "`n--- Python and PIP installation updated ---" -ForegroundColor green
112+
}
113+
114+
function Get-PatroniPackages {
115+
Write-Host "`n--- Download PATRONI packages ---" -ForegroundColor blue
116+
Set-Location "$MD\patroni"
117+
& $PIP download -r requirements.txt -d .patroni-packages
118+
& $PIP download pip pip_install setuptools wheel cdiff psycopg psycopg-binary -d .patroni-packages
119+
Set-Location -Path "..\.."
120+
Write-Host "`n--- PATRONI packages downloaded ---" -ForegroundColor green
121+
}
122+
123+
function Get-WinSW {
124+
Write-Host "`n--- Download WINSW ---" -ForegroundColor blue
125+
Invoke-WebRequest -Uri $WINSW_REF -OutFile "$MD\patroni\patroni_service.exe"
126+
Copy-Item "src\patroni_service.xml" "$MD\patroni"
127+
Copy-Item "$MD\patroni\patroni_service.exe" "$MD\etcd\etcd_service.exe" -Force
128+
Copy-Item "src\etcd_service.xml" "$MD\etcd"
129+
Copy-Item "$MD\patroni\patroni_service.exe" "$MD\vip-manager\vip_service.exe" -Force
130+
Copy-Item "src\vip_service.xml" "$MD\vip-manager"
131+
Write-Host "`n--- WINSW downloaded ---" -ForegroundColor green
132+
}
133+
134+
function Export-Assets {
135+
Write-Host "`n--- Prepare archive ---" -ForegroundColor blue
136+
Compress-ToZipFile "$MD" "$MD.zip"
137+
Write-Host "`n--- Archive compressed ---" -ForegroundColor green
138+
}

install-python.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ $PIP = "pip3.exe"
66

77
if (-Not $env:RUNNER_TOOL_CACHE) {
88
Write-Host "Running on a local machine builder" -ForegroundColor Yellow
9-
$PYTHON = "$env:ProgramFiles\Python312\python.exe"
10-
$PIP = "$env:ProgramFiles\Python312\Scripts\pip3.exe"
9+
$PYTHON = "$env:ProgramFiles\Python313\python.exe"
10+
$PIP = "$env:ProgramFiles\Python313\Scripts\pip3.exe"
1111
}
1212

1313
Write-Host "Loading the Python installation..." -ForegroundColor Blue

make.ps1

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -4,126 +4,6 @@ $ErrorActionPreference = "Stop"
44
# Set the environment variables
55
. .\env.ps1
66

7-
function Extract-ZipFile {
8-
param (
9-
[string]$zipFilePath,
10-
[string]$destinationPath
11-
)
12-
if (Test-Path $SEVENZIP) {
13-
& $SEVENZIP x "$zipFilePath" -o"$destinationPath"
14-
Start-Sleep -Seconds 5
15-
} else {
16-
Expand-Archive -Path "$zipFilePath" -DestinationPath "$destinationPath"
17-
}
18-
Remove-Item -Force "$zipFilePath" -ErrorAction Ignore
19-
}
20-
21-
function Compress-ToZipFile {
22-
param (
23-
[string]$sourcePath,
24-
[string]$destinationPath
25-
)
26-
if (Test-Path $SEVENZIP) {
27-
& $SEVENZIP a "$destinationPath" -y "$sourcePath"
28-
} else {
29-
Compress-Archive -Path "$sourcePath" -DestinationPath "$destinationPath"
30-
}
31-
}
32-
33-
function Start-Bootstrapping {
34-
Write-Host "`n--- Start bootstrapping ---" -ForegroundColor blue
35-
& ./clean.ps1
36-
New-Item -ItemType Directory -Path $MD
37-
Copy-Item "src\*.bat" $MD
38-
Copy-Item "src\*.ps1" $MD
39-
Copy-Item "doc" "$MD\doc" -Recurse
40-
Write-Host "`n--- End bootstrapping ---" -ForegroundColor green
41-
}
42-
43-
function Get-VCRedist {
44-
Write-Host "`n--- Download VCREDIST ---" -ForegroundColor blue
45-
Invoke-WebRequest -Uri $VCREDIST_REF -OutFile "$MD\vc_redist.x64.exe"
46-
Write-Host "`n--- VCREDIST downloaded ---" -ForegroundColor green
47-
}
48-
49-
function Get-ETCD {
50-
Write-Host "`n--- Download ETCD ---" -ForegroundColor blue
51-
Invoke-WebRequest -Uri $ETCD_REF -OutFile "$env:TEMP\etcd.zip"
52-
Extract-ZipFile "$env:TEMP\etcd.zip" "$MD"
53-
Rename-Item "$MD\etcd-*" "etcd"
54-
Copy-Item "src\etcd.yaml" "$MD\etcd"
55-
Write-Host "`n--- ETCD downloaded ---" -ForegroundColor green
56-
}
57-
58-
function Get-Micro {
59-
Write-Host "`n--- Download MICRO ---" -ForegroundColor blue
60-
Invoke-WebRequest -Uri $MICRO_REF -OutFile "$env:TEMP\micro.zip"
61-
Extract-ZipFile "$env:TEMP\micro.zip" "$MD"
62-
Rename-Item "$MD\micro-*" "micro"
63-
Write-Host "`n--- MICRO downloaded ---" -ForegroundColor green
64-
}
65-
66-
function Get-VIPManager {
67-
Write-Host "`n--- Download VIP-MANAGER ---" -ForegroundColor blue
68-
Invoke-WebRequest -Uri $VIP_REF -OutFile "$env:TEMP\vip.zip"
69-
Extract-ZipFile "$env:TEMP\vip.zip" "$MD"
70-
Rename-Item "$MD\vip-manager*" "vip-manager"
71-
Remove-Item "$MD\vip-manager\*.yml" -ErrorAction Ignore
72-
Copy-Item "src\vip.yaml" "$MD\vip-manager"
73-
Write-Host "`n--- VIP-MANAGER downloaded ---" -ForegroundColor green
74-
}
75-
76-
function Get-PostgreSQL {
77-
Write-Host "`n--- Download POSTGRESQL ---" -ForegroundColor blue
78-
Invoke-WebRequest -Uri $PGSQL_REF -OutFile "$env:TEMP\pgsql.zip"
79-
Extract-ZipFile "$env:TEMP\pgsql.zip" "$MD"
80-
Remove-Item -Recurse -Force "$MD\pgsql\pgAdmin 4", "$MD\pgsql\symbols" -ErrorAction Ignore
81-
Write-Host "`n--- POSTGRESQL downloaded ---" -ForegroundColor green
82-
}
83-
84-
function Get-Patroni {
85-
Write-Host "`n--- Download PATRONI ---" -ForegroundColor blue
86-
Invoke-WebRequest -Uri $PATRONI_REF -OutFile "$env:TEMP\patroni.zip"
87-
Extract-ZipFile "$env:TEMP\patroni.zip" "$MD"
88-
Rename-Item "$MD\patroni-*" "patroni"
89-
Remove-Item "$MD\patroni\postgres?.yml" -ErrorAction Ignore
90-
Copy-Item "src\patroni.yaml" "$MD\patroni"
91-
Write-Host "`n--- PATRONI downloaded ---" -ForegroundColor green
92-
}
93-
94-
function Update-PythonAndPIP {
95-
Write-Host "`n--- Update Python and PIP installation ---" -ForegroundColor blue
96-
& "./install-python.ps1"
97-
Move-Item "python-install.exe" "$MD"
98-
Write-Host "`n--- Python and PIP installation updated ---" -ForegroundColor green
99-
}
100-
101-
function Get-PatroniPackages {
102-
Write-Host "`n--- Download PATRONI packages ---" -ForegroundColor blue
103-
Set-Location "$MD\patroni"
104-
& $PIP download -r requirements.txt -d .patroni-packages
105-
& $PIP download pip pip_install setuptools wheel cdiff psycopg psycopg-binary -d .patroni-packages
106-
Set-Location -Path "..\.."
107-
Write-Host "`n--- PATRONI packages downloaded ---" -ForegroundColor green
108-
}
109-
110-
function Get-WinSW {
111-
Write-Host "`n--- Download WINSW ---" -ForegroundColor blue
112-
Invoke-WebRequest -Uri $WINSW_REF -OutFile "$MD\patroni\patroni_service.exe"
113-
Copy-Item "src\patroni_service.xml" "$MD\patroni"
114-
Copy-Item "$MD\patroni\patroni_service.exe" "$MD\etcd\etcd_service.exe" -Force
115-
Copy-Item "src\etcd_service.xml" "$MD\etcd"
116-
Copy-Item "$MD\patroni\patroni_service.exe" "$MD\vip-manager\vip_service.exe" -Force
117-
Copy-Item "src\vip_service.xml" "$MD\vip-manager"
118-
Write-Host "`n--- WINSW downloaded ---" -ForegroundColor green
119-
}
120-
121-
function Export-Assets {
122-
Write-Host "`n--- Prepare archive ---" -ForegroundColor blue
123-
Compress-ToZipFile "$MD" "$MD.zip"
124-
Write-Host "`n--- Archive compressed ---" -ForegroundColor green
125-
}
126-
1277
Start-Bootstrapping
1288
Get-VCRedist
1299
Get-ETCD

0 commit comments

Comments
 (0)