Navidrome: Call job incus_publish
This commit is contained in:
parent
ea2f41dd77
commit
f98ca93619
1 changed files with 7 additions and 26 deletions
|
@ -40,29 +40,10 @@ incus exec "$CNAME" -- sed -i \
|
||||||
|
|
||||||
# Next manual steps https://www.navidrome.org/docs/installation/linux/#create-configuration-file
|
# Next manual steps https://www.navidrome.org/docs/installation/linux/#create-configuration-file
|
||||||
|
|
||||||
# Clean
|
laminarc run incus_publish \
|
||||||
incus exec $CNAME -- \
|
CNAME="$CNAME" \
|
||||||
rm -rf \
|
UPSTREAM=$UPSTREAM_NAME \
|
||||||
/etc/machine-id \
|
UPSTREAM_VER=$UPSTREAM_VER \
|
||||||
/var/cache/apt \
|
IMAGE=$IMAGE \
|
||||||
/var/log/journal
|
SERIAL=$SERIAL \
|
||||||
|
ALIAS=$ALIAS
|
||||||
# Publish
|
|
||||||
incus stop $CNAME
|
|
||||||
incus config metadata show $CNAME > 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/" \
|
|
||||||
metadata.yaml
|
|
||||||
|
|
||||||
incus config metadata edit $CNAME < metadata.yaml
|
|
||||||
incus publish $CNAME --alias $ALIAS --public
|
|
||||||
incus rm $CNAME
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue