incus/start
This commit is contained in:
parent
b57ab0543c
commit
64f4c09230
1 changed files with 48 additions and 0 deletions
48
incus.py
Executable file
48
incus.py
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#! /usr/bin/env python3
|
||||||
|
"""Mirror local Incus."""
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
import os
|
||||||
|
|
||||||
|
from rwx.fs import make_directory, wipe
|
||||||
|
|
||||||
|
|
||||||
|
ROOT = "https://images.linuxcontainers.org"
|
||||||
|
|
||||||
|
IMAGES = f"{ROOT}/images"
|
||||||
|
META = f"{ROOT}/meta"
|
||||||
|
|
||||||
|
STREAMS = f"{META}/simplestreams/v1"
|
||||||
|
|
||||||
|
WANTED = {
|
||||||
|
"architectures": [
|
||||||
|
"amd64",
|
||||||
|
"arm64",
|
||||||
|
],
|
||||||
|
"images": {
|
||||||
|
"debian",
|
||||||
|
"arm64",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
root = Path(__file__).resolve().parent / "root"
|
||||||
|
# root path
|
||||||
|
root = root / "incus"
|
||||||
|
wipe(root)
|
||||||
|
make_directory(root)
|
||||||
|
# symlink
|
||||||
|
(root / "streams").symlink_to(os.sep.join(["meta", "simplestreams"]))
|
||||||
|
# meta
|
||||||
|
meta = root / "meta"
|
||||||
|
# streams
|
||||||
|
streams = meta / "simplestreams" / "v1"
|
||||||
|
make_directory(streams)
|
||||||
|
# images
|
||||||
|
streams = root / "images"
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Add table
Add a link
Reference in a new issue