From c4cc35279b2d997f7b5428aa78c9feb542d5746a Mon Sep 17 00:00:00 2001 From: wjunLu <135617475+wjunLu@users.noreply.github.com> Date: Wed, 7 Jun 2023 17:19:00 +0800 Subject: [PATCH] upload file --- openEuler-docker.aarch64.tar.xz | 75 +++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 openEuler-docker.aarch64.tar.xz diff --git a/openEuler-docker.aarch64.tar.xz b/openEuler-docker.aarch64.tar.xz new file mode 100644 index 0000000..c572e85 --- /dev/null +++ b/openEuler-docker.aarch64.tar.xz @@ -0,0 +1,75 @@ +import click +import docker +import wget + +class publisher: + repo = "" + version = "" + docker_file = "" + download_url = "" + + def __init__(self, repo, version): + self.repo = repo + self.version = version + + def build(self): + print("runing building task...") + client = docker.from_env() + client.images.build(path = '.', tag = 'my-latest-tag') + print("Finished!\n") + + def download(self): + self.download_url = "http://repo.openeuler.org/openEuler-" + self.version + \ + "/docker_img/aarch64/openEuler-docker.aarch64.tar.xz" + print("Download docker image from %s" % self.download_url) + wget.download(self.download_url) + print("\nDownload successfully.\n") + + def push(self): + print("runing publisher_push...") + + def check(self): + print("runing publisher_check...") + + print("result: repo<%s>, version<%s>" % (self.repo, self.version)) + + +@click.group() +@click.option("--repo", default = "openeuler/openeuler", help = "input repo") +@click.option("--version", default = "20.03-LTS", help = "input version") +@click.pass_context +def publisher_group(ctx, repo, version): + ctx.obj = {'repo' : repo, + 'version' : version} + +@click.command() +@click.pass_context +def download(ctx): + obj = publisher(ctx.obj['repo'], ctx.obj['version']) + obj.download() + +@click.command() +@click.pass_context +def build(ctx): + obj = publisher(ctx.obj['repo'], ctx.obj['version']) + obj.build() + +@click.command() +@click.pass_context +def check(ctx): + obj = publisher(ctx.obj['repo'], ctx.obj['version']) + obj.check() + +@click.command() +@click.pass_context +def push(ctx): + obj = publisher(ctx.obj['repo'], ctx.obj['version']) + obj.push() + +publisher_group.add_command(download) +publisher_group.add_command(build) +publisher_group.add_command(push) +publisher_group.add_command(check) + +if __name__ == '__main__': + publisher_group() \ No newline at end of file