-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: updated deploy environment for different podman versions
- Loading branch information
Showing
13 changed files
with
231 additions
and
17 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
# check if first argument is a valid directory | ||
if [ ! -d "$1" ]; then | ||
echo "Error: $1 is not a valid version either 'v4' or 'v5'" | ||
exit 1 | ||
fi | ||
|
||
if [ "$1" = 'v4' ]; then | ||
INSTALL_PATH="$HOME/.config/systemd/user" | ||
install -Dm644 v4/container-nginx.service "$INSTALL_PATH/container-nginx.service" | ||
install -Dm644 v4/container-php.service "$INSTALL_PATH/container-php.service" | ||
install -Dm644 v4/container-scheduler.service "$INSTALL_PATH/container-scheduler.service" | ||
install -Dm644 v4/container-worker.service "$INSTALL_PATH/container-worker.service" | ||
install -Dm644 v4/pod-parceler.service "$INSTALL_PATH/pod-parceler.service" | ||
systemctl --user daemon-reload | ||
systemctl --user reload-or-restart pod-parceler | ||
else | ||
INSTALL_PATH="$HOME/.config/containers/systemd" | ||
install -Dm644 v5/nginx.container "$INSTALL_PATH/nginx.container" | ||
install -Dm644 v5/parceler.pod "$INSTALL_PATH/parceler.pod" | ||
install -Dm644 v5/php.container "$INSTALL_PATH/php.container" | ||
install -Dm644 v5/scheduler.container "$INSTALL_PATH/scheduler.container" | ||
install -Dm644 v5/storage.volume "$INSTALL_PATH/storage.volume" | ||
install -Dm644 v5/worker.container "$INSTALL_PATH/worker.container" | ||
systemctl --user daemon-reload | ||
systemctl --user reload-or-restart parceler-pod | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# container-nginx.service | ||
|
||
[Unit] | ||
Description=Podman container-nginx.service | ||
Documentation=man:podman-generate-systemd(1) | ||
Wants=network-online.target | ||
After=network-online.target | ||
RequiresMountsFor=%t/containers | ||
BindsTo=pod-parceler.service | ||
After=pod-parceler.service | ||
|
||
[Service] | ||
Environment=PODMAN_SYSTEMD_UNIT=%n | ||
Restart=always | ||
TimeoutStopSec=70 | ||
ExecStart=/usr/bin/podman run \ | ||
--cidfile=%t/%n.ctr-id \ | ||
--cgroups=no-conmon \ | ||
--rm \ | ||
--pod-id-file %t/pod-parceler.pod-id \ | ||
--sdnotify=conmon \ | ||
--volume /etc/localtime:/etc/localtime:ro \ | ||
--env FPM_HOST=php \ | ||
--env FPM_PORT=9000 \ | ||
--name nginx \ | ||
--detach \ | ||
--replace ghcr.io/nethesis/parceler-nginx:main | ||
ExecStop=/usr/bin/podman stop \ | ||
--ignore -t 10 \ | ||
--cidfile=%t/%n.ctr-id | ||
ExecStopPost=/usr/bin/podman rm \ | ||
-f \ | ||
--ignore -t 10 \ | ||
--cidfile=%t/%n.ctr-id | ||
Type=notify | ||
NotifyAccess=all | ||
|
||
[Install] | ||
WantedBy=default.target |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# container-php.service | ||
|
||
[Unit] | ||
Description=Podman container-php.service | ||
Documentation=man:podman-generate-systemd(1) | ||
Wants=network-online.target | ||
After=network-online.target | ||
RequiresMountsFor=%t/containers | ||
BindsTo=pod-parceler.service | ||
After=pod-parceler.service | ||
|
||
[Service] | ||
Environment=PODMAN_SYSTEMD_UNIT=%n | ||
Restart=always | ||
TimeoutStopSec=70 | ||
ExecStart=/usr/bin/podman run \ | ||
--cidfile=%t/%n.ctr-id \ | ||
--cgroups=no-conmon \ | ||
--rm \ | ||
--pod-id-file %t/pod-parceler.pod-id \ | ||
--sdnotify=conmon \ | ||
--volume storage:/var/www/html \ | ||
--volume /etc/localtime:/etc/localtime:ro \ | ||
--volume %S/rclone.conf:/var/www/html/rclone.conf:ro \ | ||
--env-file %S/parceler.env \ | ||
--name php \ | ||
--detach \ | ||
--replace ghcr.io/nethesis/parceler-php:main | ||
ExecStop=/usr/bin/podman stop \ | ||
--ignore -t 10 \ | ||
--cidfile=%t/%n.ctr-id | ||
ExecStopPost=/usr/bin/podman rm \ | ||
-f \ | ||
--ignore -t 10 \ | ||
--cidfile=%t/%n.ctr-id | ||
Type=notify | ||
NotifyAccess=all | ||
|
||
[Install] | ||
WantedBy=default.target |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# container-scheduler.service | ||
|
||
[Unit] | ||
Description=Podman container-scheduler.service | ||
Documentation=man:podman-generate-systemd(1) | ||
Wants=network-online.target | ||
After=network-online.target | ||
RequiresMountsFor=%t/containers | ||
BindsTo=pod-parceler.service | ||
After=pod-parceler.service | ||
|
||
[Service] | ||
Environment=PODMAN_SYSTEMD_UNIT=%n | ||
Restart=always | ||
TimeoutStopSec=70 | ||
ExecStart=/usr/bin/podman run \ | ||
--cidfile=%t/%n.ctr-id \ | ||
--cgroups=no-conmon \ | ||
--rm \ | ||
--pod-id-file %t/pod-parceler.pod-id \ | ||
--sdnotify=conmon \ | ||
--volume storage:/var/www/html \ | ||
--volume /etc/localtime:/etc/localtime:ro \ | ||
--volume %S/rclone.conf:/var/www/html/rclone.conf:ro \ | ||
--env-file %S/parceler.env \ | ||
--env PHP_HOST=php \ | ||
--env PHP_PORT=9000 \ | ||
--name scheduler \ | ||
--detach \ | ||
--replace ghcr.io/nethesis/parceler-php:main scheduler | ||
ExecStop=/usr/bin/podman stop \ | ||
--ignore -t 10 \ | ||
--cidfile=%t/%n.ctr-id | ||
ExecStopPost=/usr/bin/podman rm \ | ||
-f \ | ||
--ignore -t 10 \ | ||
--cidfile=%t/%n.ctr-id | ||
Type=notify | ||
NotifyAccess=all | ||
|
||
[Install] | ||
WantedBy=default.target |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# container-worker.service | ||
|
||
[Unit] | ||
Description=Podman container-worker.service | ||
Documentation=man:podman-generate-systemd(1) | ||
Wants=network-online.target | ||
After=network-online.target | ||
RequiresMountsFor=%t/containers | ||
BindsTo=pod-parceler.service | ||
After=pod-parceler.service | ||
|
||
[Service] | ||
Environment=PODMAN_SYSTEMD_UNIT=%n | ||
Restart=always | ||
TimeoutStopSec=70 | ||
ExecStart=/usr/bin/podman run \ | ||
--cidfile=%t/%n.ctr-id \ | ||
--cgroups=no-conmon \ | ||
--rm \ | ||
--pod-id-file %t/pod-parceler.pod-id \ | ||
--sdnotify=conmon \ | ||
--volume storage:/var/www/html \ | ||
--volume /etc/localtime:/etc/localtime:ro \ | ||
--volume %S/rclone.conf:/var/www/html/rclone.conf:ro \ | ||
--env-file %S/parceler.env \ | ||
--env PHP_HOST=php \ | ||
--env PHP_PORT=9000 \ | ||
--name worker \ | ||
--detach \ | ||
--replace ghcr.io/nethesis/parceler-php:main worker | ||
ExecStop=/usr/bin/podman stop \ | ||
--ignore -t 10 \ | ||
--cidfile=%t/%n.ctr-id | ||
ExecStopPost=/usr/bin/podman rm \ | ||
-f \ | ||
--ignore -t 10 \ | ||
--cidfile=%t/%n.ctr-id | ||
Type=notify | ||
NotifyAccess=all | ||
|
||
[Install] | ||
WantedBy=default.target |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# pod-parceler.service | ||
|
||
[Unit] | ||
Description=Podman pod-parceler.service | ||
Documentation=man:podman-generate-systemd(1) | ||
Wants=network-online.target | ||
After=network-online.target | ||
RequiresMountsFor=/run/user/1004/containers | ||
Wants=container-nginx.service container-php.service container-scheduler.service container-worker.service | ||
Before=container-nginx.service container-php.service container-scheduler.service container-worker.service | ||
|
||
[Service] | ||
Environment=PODMAN_SYSTEMD_UNIT=%n | ||
Restart=on-failure | ||
TimeoutStopSec=70 | ||
ExecStartPre=/usr/bin/podman pod create \ | ||
--infra-conmon-pidfile %t/pod-parceler.pid \ | ||
--pod-id-file %t/pod-parceler.pod-id \ | ||
--exit-policy=stop \ | ||
--name parceler \ | ||
--publish 12121:80 \ | ||
--restart unless-stopped \ | ||
--replace | ||
ExecStart=/usr/bin/podman pod start \ | ||
--pod-id-file %t/pod-parceler.pod-id | ||
ExecStop=/usr/bin/podman pod stop \ | ||
--ignore \ | ||
--pod-id-file %t/pod-parceler.pod-id \ | ||
-t 10 | ||
ExecStopPost=/usr/bin/podman pod rm \ | ||
--ignore \ | ||
-f \ | ||
--pod-id-file %t/pod-parceler.pod-id | ||
PIDFile=%t/pod-parceler.pid | ||
Type=forking | ||
|
||
[Install] | ||
WantedBy=default.target |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.