Skip to content

Commit

Permalink
[+] Add service wrappers to the package, closes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
pashagolub committed Aug 14, 2020
1 parent d2fb085 commit cef9caf
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 99 deletions.
8 changes: 8 additions & 0 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SET MD=patroni-win-x64
SET ETCD_REF=https://github.com/etcd-io/etcd/releases/download/v3.3.22/etcd-v3.3.22-windows-amd64.zip
SET PATRONI_REF=https://github.com/zalando/patroni/archive/v1.6.5.zip
SET MICRO_REF=https://github.com/zyedidia/micro/releases/download/v2.0.6/micro-2.0.6-win64.zip
SET WINSW_REF=https://github.com/winsw/winsw/releases/download/v2.9.0/WinSW.NET461.exe

@ECHO --- Start bootstrapping ---

Expand All @@ -28,6 +29,13 @@ powershell -Command "Expand-Archive '%TEMP%\micro.zip' '%CD%'"
MOVE micro-* %MD%\micro
@ECHO --- MICRO downloaded ---

@ECHO --- Download WINSW ---
MKDIR %MD%\service
curl %MICRO_REF% --location --output %MD%\service\patroni_service.exe
COPY %MD%\service\patroni_service.exe %MD%\service\etcd_service.exe /B
COPY %MD%\service\patroni_service.exe %MD%\service\vip_service.exe /B
@ECHO --- WINSW downloaded ---

@ECHO --- Download PATRONI ---
curl %PATRONI_REF% --location --output %TEMP%\patroni.zip
powershell -Command "Expand-Archive '%TEMP%\patroni.zip' '%CD%'"
Expand Down
7 changes: 7 additions & 0 deletions src/etcd_service.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<service>
<id>etcd</id>
<name>etcd</name>
<description>Distributed reliable key-value store</description>
<executable>%BASE%\etcd\ectd.exe</executable>
<arguments>--config-file=%BASE%\etcd.conf</arguments>
</service>
File renamed without changes.
14 changes: 14 additions & 0 deletions src/patroni_service.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<service>
<id>patroni</id>
<name>Patroni HA Windows Service</name>
<description>Patroni high-availability solution using Python and etcd</description>
<executable>C:\Users\pasha\AppData\Local\Programs\Python\Python38\python.exe</executable>
<arguments>%BASE%\patroni\patroni.py %BASE%\postgres-win0.yml</arguments>
<stopparentprocessfirst>true</stopparentprocessfirst>
<log mode="roll"></log>
<logpath>%BASE%\log</logpath>
<serviceaccount>
<user>postgres</username>
<password>12345</password>
</serviceaccount>
</service>
99 changes: 0 additions & 99 deletions src/postgres-win1.yml

This file was deleted.

7 changes: 7 additions & 0 deletions src/vip_service.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<service>
<id>vip-manager</id>
<name>vip-manager</name>
<description>Manager for a virtual IP based on state kept in etcd or Consul </description>
<executable>%BASE%\vip-manager\vip-manager.exe</executable>
<arguments>-config %BASE%\vip-manager.yml</arguments>
</service>

0 comments on commit cef9caf

Please sign in to comment.