Moving /app tree in ignition to gzipped file
This commit is contained in:
9
Makefile
9
Makefile
@@ -66,6 +66,12 @@ restic-env: $(apps_config) make-restic-generated.sh
|
|||||||
restic-password: $(apps_config) make-restic-password.sh
|
restic-password: $(apps_config) make-restic-password.sh
|
||||||
./make-restic-password.sh $(apps_config) > restic-password
|
./make-restic-password.sh $(apps_config) > restic-password
|
||||||
|
|
||||||
|
app.tar.gz: app/.dirstamp \
|
||||||
|
app/.env \
|
||||||
|
app/lb/lb.env \
|
||||||
|
app/lb/Caddyfile
|
||||||
|
tar cfz app.tar.gz app/
|
||||||
|
|
||||||
ignition.json: cl.yaml app/.dirstamp \
|
ignition.json: cl.yaml app/.dirstamp \
|
||||||
$(IMAGE_DEPS) \
|
$(IMAGE_DEPS) \
|
||||||
app/lb/lb.env \
|
app/lb/lb.env \
|
||||||
@@ -75,7 +81,8 @@ restic-password \
|
|||||||
restic-restore.sh \
|
restic-restore.sh \
|
||||||
restic-snapshot.sh \
|
restic-snapshot.sh \
|
||||||
app/.env \
|
app/.env \
|
||||||
$(config_dir)ssh-keys
|
$(config_dir)ssh-keys \
|
||||||
|
app.tar.gz
|
||||||
cat cl.yaml | docker run --rm --volume $(config_dir)/ssh-keys:/pwd/ssh-keys --volume ${PWD}:/pwd --workdir /pwd -i quay.io/coreos/butane:latest -d /pwd > ignition.json
|
cat cl.yaml | docker run --rm --volume $(config_dir)/ssh-keys:/pwd/ssh-keys --volume ${PWD}:/pwd --workdir /pwd -i quay.io/coreos/butane:latest -d /pwd > ignition.json
|
||||||
|
|
||||||
generated.tfvars: $(apps_config) make-generated.sh
|
generated.tfvars: $(apps_config) make-generated.sh
|
||||||
|
|||||||
31
cl.yaml
31
cl.yaml
@@ -80,6 +80,18 @@ systemd:
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
- name: unpack-app.service
|
||||||
|
enabled: true
|
||||||
|
contents: |
|
||||||
|
[Unit]
|
||||||
|
Description=Unpack /app
|
||||||
|
Before=app.service
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/unpack-app
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
### docker-compose sysext
|
### docker-compose sysext
|
||||||
### https://flatcar.github.io/sysext-bakery/docker_compose/
|
### https://flatcar.github.io/sysext-bakery/docker_compose/
|
||||||
- name: systemd-sysupdate.timer
|
- name: systemd-sysupdate.timer
|
||||||
@@ -117,10 +129,14 @@ storage:
|
|||||||
- device: /dev/disk/by-partlabel/appstorage
|
- device: /dev/disk/by-partlabel/appstorage
|
||||||
format: ext4
|
format: ext4
|
||||||
wipe_filesystem: false
|
wipe_filesystem: false
|
||||||
trees:
|
# trees:
|
||||||
- path: /app
|
# - path: /app
|
||||||
local: app
|
# local: app
|
||||||
files:
|
files:
|
||||||
|
- path: /app.tar.gz
|
||||||
|
mode: 0600
|
||||||
|
contents:
|
||||||
|
local: app.tar.gz
|
||||||
- path: /restic-password
|
- path: /restic-password
|
||||||
contents:
|
contents:
|
||||||
local: restic-password
|
local: restic-password
|
||||||
@@ -143,6 +159,15 @@ storage:
|
|||||||
inline: |
|
inline: |
|
||||||
PermitRootLogin no
|
PermitRootLogin no
|
||||||
AllowUsers core
|
AllowUsers core
|
||||||
|
- path: /unpack-app
|
||||||
|
mode: 0755
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
mkdir /app
|
||||||
|
tar -xzf /app.tar.gz -C /
|
||||||
|
rm /app.tar.gz
|
||||||
### docker-compose sysext
|
### docker-compose sysext
|
||||||
### https://flatcar.github.io/sysext-bakery/docker_compose/
|
### https://flatcar.github.io/sysext-bakery/docker_compose/
|
||||||
- path: /opt/extensions/docker-compose/docker-compose-5.1.4-x86-64.raw
|
- path: /opt/extensions/docker-compose/docker-compose-5.1.4-x86-64.raw
|
||||||
|
|||||||
Reference in New Issue
Block a user