add new struct
This commit is contained in:
parent
65d2e24f35
commit
ac2dd765fe
65
build.py
65
build.py
@ -1,10 +1,12 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
from os import walk
|
||||
from pathlib import Path
|
||||
import urllib.request
|
||||
import shutil
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
|
||||
from jinja2 import Template
|
||||
import json
|
||||
@ -19,11 +21,11 @@ dockerfile = "Dockerfile"
|
||||
arch_map= {'amd64': "x86_64", '386': "i586", 'arm64': "aarch64", "riscv64": "riscv64", "loong64": "loongarch64" }
|
||||
|
||||
def parse_args():
|
||||
registry = "gitea.basealt.ru"
|
||||
registry = "gitea.basealt.ru/alt"
|
||||
arches = ["amd64", "386", "arm64", "loong64", "riscv64"]
|
||||
names=["alt"]
|
||||
latest_tag="p10"
|
||||
org="alt"
|
||||
#org="alt"
|
||||
branches=["p11", "p10", "Sisyphus"]
|
||||
exclusions='{"p10": ["loong64", "riscv64"], "p11": ["loong64", "riscv64"]}'
|
||||
|
||||
@ -67,15 +69,19 @@ def parse_args():
|
||||
"--registry",
|
||||
default=registry,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--org",
|
||||
default=org,
|
||||
)
|
||||
#parser.add_argument(
|
||||
# "--org",
|
||||
# default=org,
|
||||
#)
|
||||
parser.add_argument(
|
||||
"--no-push",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--use-local-source",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
@ -84,10 +90,14 @@ def parse_args():
|
||||
help="tag images in this branch as latest",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--old-structure",
|
||||
"--old-structure",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--new-structure",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=True,
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
@ -156,9 +166,9 @@ def main():
|
||||
LIC=LIC_C
|
||||
|
||||
tag = br.lower()
|
||||
#new_tag = datetime.now().strftime("%Y%m%d")
|
||||
manifest = f'{args.registry}/{args.org}/{imgname}'
|
||||
#new_manifest = f"args.registry/{br}/{imgname}"
|
||||
new_tag = datetime.now().strftime("%Y%m%d")
|
||||
manifest = f'{args.registry}/{imgname}'
|
||||
new_manifest = f'{args.registry}/{br}/{imgname}'
|
||||
|
||||
excl_arches = []
|
||||
if args.exclusions is not None and args.exclusions.get(br) is not None:
|
||||
@ -234,20 +244,37 @@ def main():
|
||||
continue
|
||||
|
||||
print(f'push manifest to registry {args.registry}')
|
||||
|
||||
run(["podman",
|
||||
"manifest",
|
||||
"push",
|
||||
"--all",
|
||||
f"{manifest}:{tag}",
|
||||
f"docker://{manifest}:{tag}",
|
||||
])
|
||||
|
||||
if args.old_structure:
|
||||
run(["podman",
|
||||
"manifest",
|
||||
"push",
|
||||
"--all",
|
||||
f"{manifest}:{tag}",
|
||||
f"docker://{manifest}:{tag}",
|
||||
])
|
||||
if args.new_structure:
|
||||
run(["podman",
|
||||
"manifest",
|
||||
"push",
|
||||
"--all",
|
||||
f"{manifest}:{tag}",
|
||||
f"docker://{new_manifest}:{new_tag}",
|
||||
])
|
||||
run(["podman",
|
||||
"manifest",
|
||||
"push",
|
||||
"--all",
|
||||
f"{manifest}:{tag}",
|
||||
f"docker://{new_manifest}:latest",
|
||||
])
|
||||
|
||||
print(f'manifest {manifest}:{tag} is pushed to registry {args.registry}')
|
||||
|
||||
if args.latest == br:
|
||||
print(f"push latest tag")
|
||||
run(["podman",
|
||||
if args.old_structure:
|
||||
run(["podman",
|
||||
"manifest",
|
||||
"push",
|
||||
"--all",
|
||||
|
Loading…
x
Reference in New Issue
Block a user