mirror of
https://github.com/deuill/coreos-home-server.git
synced 2024-09-21 21:50:46 +00:00
Alex Palaistras
3254ead3a7
This commit represents a large amount of work toward moving services to a more standard approach to storing data, and a simplification in how networks are managed.
20 lines
855 B
Desktop File
20 lines
855 B
Desktop File
[Unit]
|
|
Description=MariaDB SQL migration for %I
|
|
Wants=container-environment@%i.service mariadb.service
|
|
After=container-environment@%i.service mariadb.service
|
|
ConditionPathExists=/etc/container-service/%i/service/%p.sql
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
PrivateTmp=true
|
|
EnvironmentFile=-%E/container-service/%i/%i.env
|
|
EnvironmentFile=%E/container-service/mariadb/mariadb.env
|
|
ExecStartPre=/bin/sh -c 'envsubst < %E/container-service/%i/service/%p.sql > /tmp/%p.sql'
|
|
ExecStart=/bin/podman run --replace --pull never --rm --name mariadb-migrate-%i --net internal \
|
|
--volume mariadb:/var/lib/mysql:z --volume /tmp:/tmp \
|
|
--entrypoint mariadb localhost/mariadb:latest \
|
|
--host mariadb --user root --password=${MYSQL_ROOT_PASSWORD} -e 'source /tmp/%p.sql'
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|