Compare commits
No commits in common. "887f614e204287fe215fe7ba94e8f9adbc2496c4" and "16ecb9e5c5c8d62ce2a6c8d004cdd16a4dc31122" have entirely different histories.
887f614e20
...
16ecb9e5c5
3 changed files with 57 additions and 15 deletions
|
@ -50,10 +50,29 @@ incus exec $CNAME -- \
|
||||||
https://codeberg.org/forgejo/forgejo/raw/branch/forgejo/contrib/systemd/forgejo.service
|
https://codeberg.org/forgejo/forgejo/raw/branch/forgejo/contrib/systemd/forgejo.service
|
||||||
#incus file push setup.sh $CNAME/usr/local/bin/
|
#incus file push setup.sh $CNAME/usr/local/bin/
|
||||||
|
|
||||||
laminarc run incus_publish \
|
# Clean
|
||||||
CNAME="$CNAME" \
|
incus exec $CNAME -- \
|
||||||
UPSTREAM=$UPSTREAM_NAME \
|
rm -rf \
|
||||||
UPSTREAM_VER=$UPSTREAM_VER \
|
/etc/machine-id \
|
||||||
IMAGE=$IMAGE \
|
/var/cache/apt \
|
||||||
SERIAL=$SERIAL \
|
/var/log/journal
|
||||||
ALIAS=$ALIAS
|
|
||||||
|
# Publish
|
||||||
|
incus stop $CNAME
|
||||||
|
incus config metadata show $CNAME > $ARCHIVE/metadata.yaml
|
||||||
|
# Get the current Unix timestamp
|
||||||
|
current_timestamp=$(date +%s)
|
||||||
|
# Calculate expiry date as current timestamp + 1 week (604800 seconds)
|
||||||
|
expiry_date=$(($current_timestamp + 604800))
|
||||||
|
# Update metadata values
|
||||||
|
sed -i \
|
||||||
|
-e "s/creation_date: .*/creation_date: $current_timestamp/" \
|
||||||
|
-e "s/expiry_date: .*/expiry_date: $expiry_date/" \
|
||||||
|
-e "s#description: .*#description: $UPSTREAM_NAME v$UPSTREAM_VER on $IMAGE release $SERIAL#" \
|
||||||
|
-e "s/name: .*/name: $CNAME/" \
|
||||||
|
-e "s/serial: .*/serial: $SERIAL/" \
|
||||||
|
$ARCHIVE/metadata.yaml
|
||||||
|
|
||||||
|
incus config metadata edit $CNAME < $ARCHIVE/metadata.yaml
|
||||||
|
incus publish $CNAME --alias $ALIAS --public --quiet
|
||||||
|
incus rm $CNAME
|
||||||
|
|
|
@ -17,7 +17,7 @@ ALIAS="$UPSTREAM_NAME-$UPSTREAM_VER-$SERIAL"
|
||||||
cd "$WORKSPACE"
|
cd "$WORKSPACE"
|
||||||
incus launch images:$IMAGE "$CNAME" --quiet
|
incus launch images:$IMAGE "$CNAME" --quiet
|
||||||
|
|
||||||
wait_network "$CNAME"
|
wait_network $CNAME
|
||||||
|
|
||||||
# Mastodon
|
# Mastodon
|
||||||
incus exec "$CNAME" -- bash -c '
|
incus exec "$CNAME" -- bash -c '
|
||||||
|
@ -40,10 +40,32 @@ incus exec "$CNAME" \
|
||||||
--force-noninteractive \
|
--force-noninteractive \
|
||||||
-- bash /tmp/setup_mastodon.sh
|
-- bash /tmp/setup_mastodon.sh
|
||||||
|
|
||||||
laminarc run incus_publish \
|
# Clean
|
||||||
CNAME="$CNAME" \
|
incus exec "$CNAME" -- \
|
||||||
UPSTREAM=$UPSTREAM_NAME \
|
rm -rf \
|
||||||
UPSTREAM_VER=$UPSTREAM_VER \
|
/etc/machine-id \
|
||||||
IMAGE=$IMAGE \
|
/var/cache/apt \
|
||||||
SERIAL=$SERIAL \
|
/var/log/journal
|
||||||
ALIAS=$ALIAS
|
|
||||||
|
# Publish
|
||||||
|
incus stop "$CNAME"
|
||||||
|
incus config metadata show "$CNAME" > "$ARCHIVE"/metadata.yaml
|
||||||
|
# Get the current Unix timestamp
|
||||||
|
current_timestamp=$(date +%s)
|
||||||
|
# Calculate expiry date as current timestamp + 1 week (604800 seconds)
|
||||||
|
expiry_date=$((current_timestamp + 604800))
|
||||||
|
# Update metadata values
|
||||||
|
sed -i \
|
||||||
|
-e "s/creation_date: .*/creation_date: $current_timestamp/" \
|
||||||
|
-e "s/expiry_date: .*/expiry_date: $expiry_date/" \
|
||||||
|
-e "s#description: .*#description: $UPSTREAM_NAME v$UPSTREAM_VER on $IMAGE release $SERIAL#" \
|
||||||
|
-e "s/name: .*/name: $CNAME/" \
|
||||||
|
-e "s/serial: .*/serial: $SERIAL/" \
|
||||||
|
"$ARCHIVE"/metadata.yaml
|
||||||
|
|
||||||
|
incus config metadata edit "$CNAME" < "$ARCHIVE"/metadata.yaml
|
||||||
|
incus publish "$CNAME" \
|
||||||
|
--alias $ALIAS \
|
||||||
|
--public \
|
||||||
|
--quiet
|
||||||
|
incus rm "$CNAME"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
# Upstream doc: https://www.navidrome.org/docs/installation/linux/
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
CNAME="$1"
|
CNAME="$1"
|
||||||
|
|
Loading…
Add table
Reference in a new issue