From c64ced0e529679a027586da7826215058a4e23ff Mon Sep 17 00:00:00 2001 From: Alexander Stepchenko Date: Mon, 27 Mar 2023 18:18:25 +0300 Subject: [PATCH] Switch from json to toml --- build.py | 8 +++---- images-info.json | 62 ------------------------------------------------ images-info.toml | 59 +++++++++++++++++++++++++++++++++++++++++++++ tags.json | 50 -------------------------------------- tags.toml | 47 ++++++++++++++++++++++++++++++++++++ tasks.json | 7 ------ tasks.toml | 4 ++++ 7 files changed, 114 insertions(+), 123 deletions(-) delete mode 100644 images-info.json create mode 100644 images-info.toml delete mode 100644 tags.json create mode 100644 tags.toml delete mode 100644 tasks.json create mode 100644 tasks.toml diff --git a/build.py b/build.py index dd3c7e7..852d519 100755 --- a/build.py +++ b/build.py @@ -28,7 +28,7 @@ class Tasks: if tasks is None: self._tasks = None else: - self._tasks = json.loads(Path(tasks).read_text()) + self._tasks = tomli.loads(Path(tasks).read_text()) def get(self, branch, image: Image): if self._tasks is None: @@ -48,7 +48,7 @@ class Tags: self._tags = None else: tags_file = Path(tags_file) - self._tags = json.loads(tags_file.read_text()) + self._tags = tomli.loads(tags_file.read_text()) self._latest = latest def tags(self, branch, image: Image): @@ -606,9 +606,9 @@ class DockerBuilder: class ImagesInfo: def __init__(self): info = {} - images_info = Path("images-info.json") + images_info = Path("images-info.toml") if images_info.exists(): - info = json.loads(images_info.read_text()) + info = tomli.loads(images_info.read_text()) self._info = info diff --git a/images-info.json b/images-info.json deleted file mode 100644 index 24411fe..0000000 --- a/images-info.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "alt/distroless-base": { - "skip-branches": ["p9"] - }, - "alt/distroless-builder": { - "skip-branches": ["p9"] - }, - "alt/distroless-devel": { - "skip-branches": ["p9"] - }, - "alt/distroless-gotop": { - "skip-branches": ["p9"] - }, - "alt/distroless-static": { - "skip-branches": ["p9"] - }, - "alt/distroless-true": { - "skip-branches": ["p9"] - }, - "alt/gitea": { - "skip-branches": ["p9"] - }, - "alt/unit": { - "skip-branches": ["p9"] - }, - "alt/prometheus": { - "skip-branches": ["p9"] - }, - "alt/registry": { - "skip-branches": ["p9"] - }, - "k8s/cert-manager-cainjector": { - "skip-branches": ["p9"] - }, - "k8s/cert-manager-controller": { - "skip-branches": ["p9"] - }, - "k8s/cert-manager-webhook": { - "skip-branches": ["p9"] - }, - "k8s/coredns": { - "skip-branches": ["p9"] - }, - "k8s/etcd": { - "skip-branches": ["p9"] - }, - "k8s/kube-apiserver": { - "skip-branches": ["p9"] - }, - "k8s/kube-controller-manager": { - "skip-branches": ["p9"] - }, - "k8s/kube-proxy": { - "skip-branches": ["p9"] - }, - "k8s/kube-scheduler": { - "skip-branches": ["p9"] - }, - "k8s/pause": { - "skip-branches": ["p9"] - } -} diff --git a/images-info.toml b/images-info.toml new file mode 100644 index 0000000..f6801e6 --- /dev/null +++ b/images-info.toml @@ -0,0 +1,59 @@ +["alt/distroless-base"] +skip-branches = [ "p9" ] + +["alt/distroless-builder"] +skip-branches = [ "p9" ] + +["alt/distroless-devel"] +skip-branches = [ "p9" ] + +["alt/distroless-gotop"] +skip-branches = [ "p9" ] + +["alt/distroless-static"] +skip-branches = [ "p9" ] + +["alt/distroless-true"] +skip-branches = [ "p9" ] + +["alt/gitea"] +skip-branches = [ "p9" ] + +["alt/unit"] +skip-branches = [ "p9" ] + +["alt/prometheus"] +skip-branches = [ "p9" ] + +["alt/registry"] +skip-branches = [ "p9" ] + +["k8s/cert-manager-cainjector"] +skip-branches = [ "p9" ] + +["k8s/cert-manager-controller"] +skip-branches = [ "p9" ] + +["k8s/cert-manager-webhook"] +skip-branches = [ "p9" ] + +["k8s/coredns"] +skip-branches = [ "p9" ] + +["k8s/etcd"] +skip-branches = [ "p9" ] + +["k8s/kube-apiserver"] +skip-branches = [ "p9" ] + +["k8s/kube-controller-manager"] +skip-branches = [ "p9" ] + +["k8s/kube-proxy"] +skip-branches = [ "p9" ] + +["k8s/kube-scheduler"] +skip-branches = [ "p9" ] + +["k8s/pause"] +skip-branches = [ "p9" ] diff --git a/tags.json b/tags.json deleted file mode 100644 index df81847..0000000 --- a/tags.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "k8s/cert-manager-cainjector": { - "p10": ["v1.9.1"], - "sisyphus": ["v1.9.1"] - }, - "k8s/cert-manager-controller": { - "p10": ["v1.9.1"], - "sisyphus": ["v1.9.1"] - }, - "k8s/cert-manager-webhook": { - "p10": ["v1.9.1"], - "sisyphus": ["v1.9.1"] - }, - "k8s/coredns": { - "p10": ["v1.8.6"], - "sisyphus": ["v1.8.6"] - }, - "k8s/etcd": { - "p10": ["3.5.5-0"], - "sisyphus": ["3.5.5-0"] - }, - "k8s/flannel": { - "p10": ["v0.19.2"], - "sisyphus": ["v0.19.2"] - }, - "k8s/flannel-cni-plugin": { - "p10": ["v1.2.0"], - "sisyphus": ["v1.2.0"] - }, - "k8s/kube-apiserver": { - "p10": ["v1.24.8"], - "sisyphus": ["v1.24.8"] - }, - "k8s/kube-controller-manager": { - "p10": ["v1.24.8"], - "sisyphus": ["v1.24.8"] - }, - "k8s/kube-proxy": { - "p10": ["v1.24.8"], - "sisyphus": ["v1.24.8"] - }, - "k8s/kube-scheduler": { - "p10": ["v1.24.8"], - "sisyphus": ["v1.24.8"] - }, - "k8s/pause": { - "p10": ["3.7"], - "sisyphus": ["3.7"] - } -} diff --git a/tags.toml b/tags.toml new file mode 100644 index 0000000..60bc86a --- /dev/null +++ b/tags.toml @@ -0,0 +1,47 @@ +["k8s/kube-apiserver"] +p10 = [ "v1.24.8" ] +sisyphus = [ "v1.24.8" ] + +["k8s/kube-controller-manager"] +p10 = [ "v1.24.8" ] +sisyphus = [ "v1.24.8" ] + +["k8s/kube-scheduler"] +p10 = [ "v1.24.8" ] +sisyphus = [ "v1.24.8" ] + +["k8s/kube-proxy"] +p10 = [ "v1.24.8" ] +sisyphus = [ "v1.24.8" ] + +["k8s/pause"] +p10 = [ "3.7" ] +sisyphus = [ "3.7" ] + +["k8s/etcd"] +p10 = [ "3.5.5-0" ] +sisyphus = [ "3.5.5-0" ] + +["k8s/coredns"] +p10 = [ "v1.8.6" ] +sisyphus = [ "v1.8.6" ] + +["k8s/cert-manager-cainjector"] +p10 = [ "v1.9.1" ] +sisyphus = [ "v1.9.1" ] + +["k8s/cert-manager-controller"] +p10 = [ "v1.9.1" ] +sisyphus = [ "v1.9.1" ] + +["k8s/cert-manager-webhook"] +p10 = [ "v1.9.1" ] +sisyphus = [ "v1.9.1" ] + +["k8s/flannel"] +p10 = [ "v0.19.2" ] +sisyphus = [ "v0.19.2" ] + +["k8s/flannel-cni-plugin"] +p10 = [ "v1.2.0" ] +sisyphus = [ "v1.2.0" ] diff --git a/tasks.json b/tasks.json deleted file mode 100644 index d5dead5..0000000 --- a/tasks.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "p10": { - "312495": ["k8s/flannel-cni-plugin"], - "312496": ["k8s/flannel"], - "316352": ["k8s/pause"] - } -} diff --git a/tasks.toml b/tasks.toml new file mode 100644 index 0000000..ad96c4d --- /dev/null +++ b/tasks.toml @@ -0,0 +1,4 @@ +[p10] +312495 = [ "k8s/flannel-cni-plugin" ] +312496 = [ "k8s/flannel" ] +316352 = [ "k8s/pause" ]