chore: move to post-stages
This commit is contained in:
parent
a4c8b144c5
commit
1424a3599d
3 changed files with 18 additions and 20 deletions
57
oci.yaml
Normal file
57
oci.yaml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
track: "base"
|
||||
|
||||
modules:
|
||||
- name: exec
|
||||
run: |
|
||||
for cmd in "$@"; do
|
||||
bash -s <<< "$cmd"
|
||||
done
|
||||
|
||||
needs-update:
|
||||
- |
|
||||
[[ "$(cat /usr/revision)" == "$(skopeo inspect "$IMAGE_NAME" | jq '.Labels."org.opencontainers.image.revision" // "none"' -Mcrj)" ]]
|
||||
|
||||
override:
|
||||
- path: /var/cache/blendOS/
|
||||
keep: old
|
||||
|
||||
auto-update:
|
||||
enabled: true
|
||||
interval: 3600
|
||||
|
||||
distro-config:
|
||||
initialise: |
|
||||
set -e
|
||||
|
||||
mkdir -p /var/cache/blendOS/container/blobs
|
||||
|
||||
if [[ -z "$IMAGE_NAME" ]]; then
|
||||
echo "E: no image name specified"
|
||||
echo "I: (define IMAGE_NAME in env section)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
skopeo copy "$IMAGE_NAME" --dest-shared-blob-dir=/var/cache/blendOS/blobs oci:image:main
|
||||
rm -rf image/blobs
|
||||
ln -s /var/cache/blendOS/blobs image/blobs
|
||||
umoci unpack --image image:main bundle
|
||||
rm image/blobs
|
||||
|
||||
cp -ax bundle/"$(jq '.root.path // "rootfs"' -Mcrj bundle/config.json)"/* .
|
||||
jq '.annotations."org.opencontainers.image.revision" // empty' -Mcrj bundle/config.json > ./usr/revision
|
||||
rm -rf bundle
|
||||
|
||||
mkdir -p ./var/cache/blendOS
|
||||
mount --bind /var/cache/blendOS ./var/cache/blendOS
|
||||
|
||||
ln -sfn usr/lib64 ./lib64
|
||||
ln -sfn usr/sbin ./sbin
|
||||
|
||||
cp /etc/locale.gen ./etc
|
||||
cp /etc/locale.conf ./etc
|
||||
|
||||
finalise: |
|
||||
umount -l ./var/cache/blendOS &>/dev/null
|
||||
|
||||
env:
|
||||
IMAGE_NAME: ""
|
||||
Loading…
Add table
Add a link
Reference in a new issue