55
66from pygments .lexer import default
77
8- from .registry import GlociRegistry
8+ from .container import Container
99
1010
1111@click .group ()
@@ -26,6 +26,13 @@ def cli():
2626 type = click .Path (),
2727 help = "Version of image" ,
2828)
29+ @click .option (
30+ "--commit" ,
31+ required = False ,
32+ type = click .Path (),
33+ default = None ,
34+ help = "Commit of image" ,
35+ )
2936@click .option (
3037 "--arch" ,
3138 required = True ,
@@ -60,6 +67,7 @@ def cli():
6067def push_manifest (
6168 container ,
6269 version ,
70+ commit ,
6371 arch ,
6472 cname ,
6573 directory ,
@@ -69,17 +77,19 @@ def push_manifest(
6977 additional_tag ,
7078):
7179 """push artifacts from a dir to a registry, get the index-entry for the manifest in return"""
72- container_name = f"{ container } :{ version } "
73- registry = GlociRegistry (
74- container_name = container_name ,
75- token = os .getenv ("GL_CLI_REGISTRY_TOKEN" ),
80+ container = Container (
81+ f"{ container } :{ version } " ,
7682 insecure = insecure ,
7783 )
78- digest = registry .push_from_dir (
79- arch , version , cname , directory , manifest_file , additional_tag
84+
85+ manifest = container .read_or_generate_manifest (cname , arch , version , commit )
86+
87+ container .push_manifest_and_artifacts_from_directory (
88+ manifest , directory , manifest_file , additional_tag
8089 )
90+
8191 if cosign_file :
82- print (digest , file = open (cosign_file , "w" ))
92+ print (manifest . digest , file = open (cosign_file , "w" ))
8393
8494
8595@cli .command ()
@@ -115,13 +125,12 @@ def push_manifest(
115125)
116126def update_index (container , version , manifest_folder , insecure , additional_tag ):
117127 """push a index entry from a list of files to an index"""
118- container_name = f"{ container } :{ version } "
119- registry = GlociRegistry (
120- container_name = container_name ,
121- token = os .getenv ("GL_CLI_REGISTRY_TOKEN" ),
128+ container = Container (
129+ f"{ container } :{ version } " ,
122130 insecure = insecure ,
123131 )
124- registry .update_index (manifest_folder , additional_tag )
132+
133+ container .push_index_from_directory (manifest_folder , additional_tag )
125134
126135
127136def main ():
0 commit comments