|
5 | 5 |
|
6 | 6 | from pygments.lexer import default |
7 | 7 |
|
8 | | -from .registry import GlociRegistry |
| 8 | +from .container import Container |
9 | 9 |
|
10 | 10 |
|
11 | 11 | @click.group() |
@@ -71,16 +71,21 @@ def push_manifest( |
71 | 71 | ): |
72 | 72 | """push artifacts from a dir to a registry, get the index-entry for the manifest in return""" |
73 | 73 | container_name = f"{container}:{version}" |
74 | | - registry = GlociRegistry( |
| 74 | + |
| 75 | + container = Container( |
75 | 76 | container_name=container_name, |
76 | 77 | token=os.getenv("GL_CLI_REGISTRY_TOKEN"), |
77 | 78 | insecure=insecure, |
78 | 79 | ) |
79 | | - digest = registry.push_from_dir( |
80 | | - arch, version, cname, directory, manifest_file, commit=commit |
| 80 | + |
| 81 | + manifest = container.read_or_generate_manifest(cname, arch, version, commit) |
| 82 | + |
| 83 | + container.push_manifest_and_artifacts_from_directory( |
| 84 | + manifest, directory, manifest_file |
81 | 85 | ) |
| 86 | + |
82 | 87 | if cosign_file: |
83 | | - print(digest, file=open(cosign_file, "w")) |
| 88 | + print(manifest["digest"], file=open(cosign_file, "w")) |
84 | 89 |
|
85 | 90 |
|
86 | 91 | @cli.command() |
@@ -111,12 +116,12 @@ def push_manifest( |
111 | 116 | def update_index(container, version, manifest_folder, insecure): |
112 | 117 | """push a index entry from a list of files to an index""" |
113 | 118 | container_name = f"{container}:{version}" |
114 | | - registry = GlociRegistry( |
| 119 | + container = Container( |
115 | 120 | container_name=container_name, |
116 | 121 | token=os.getenv("GL_CLI_REGISTRY_TOKEN"), |
117 | 122 | insecure=insecure, |
118 | 123 | ) |
119 | | - registry.update_index(manifest_folder) |
| 124 | + container.push_index_from_directory(manifest_folder) |
120 | 125 |
|
121 | 126 |
|
122 | 127 | def main(): |
|
0 commit comments