Compare commits
1 Commits
master
...
remove-whi
Author | SHA1 | Date | |
---|---|---|---|
d4d68fd1c6 |
30
build.py
30
build.py
@ -244,7 +244,7 @@ class Tags:
|
|||||||
tags.append("latest")
|
tags.append("latest")
|
||||||
else:
|
else:
|
||||||
tags = self._tags[image.canonical_name][branch].copy()
|
tags = self._tags[image.canonical_name][branch].copy()
|
||||||
|
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
|
|
||||||
@ -529,7 +529,7 @@ class DockerBuilder:
|
|||||||
|
|
||||||
logger.debug("run: %s", pre_cmd + cmd)
|
logger.debug("run: %s", pre_cmd + cmd)
|
||||||
subprocess.run(pre_cmd + cmd, *args, **kwargs)
|
subprocess.run(pre_cmd + cmd, *args, **kwargs)
|
||||||
|
|
||||||
def run_with_result(self, cmd):
|
def run_with_result(self, cmd):
|
||||||
return subprocess.run(cmd, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
return subprocess.run(cmd, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||||
|
|
||||||
@ -771,18 +771,18 @@ class DockerBuilder:
|
|||||||
f"--platform={platforms}",
|
f"--platform={platforms}",
|
||||||
".",
|
".",
|
||||||
]
|
]
|
||||||
|
|
||||||
if image.annotations != None:
|
if image.annotations != None:
|
||||||
build_cmd = [
|
build_cmd = [
|
||||||
"podman",
|
"podman",
|
||||||
"build",
|
"build",
|
||||||
"--rm",
|
"--rm",
|
||||||
"--force-rm",
|
"--force-rm",
|
||||||
f"--manifest={manifest}",
|
f"--manifest={manifest}",
|
||||||
f"--platform={platforms}"
|
f"--platform={platforms}"
|
||||||
]
|
]
|
||||||
for akey, avalue in image.annotations.items():
|
for akey, avalue in image.annotations.items():
|
||||||
build_cmd.append(
|
build_cmd.append(
|
||||||
f"--annotation={akey}={avalue}")
|
f"--annotation={akey}={avalue}")
|
||||||
|
|
||||||
d = datetime.now()
|
d = datetime.now()
|
||||||
@ -793,20 +793,20 @@ class DockerBuilder:
|
|||||||
build_cmd.append(f"--annotation=org.opencontainers.image.version={ver}")
|
build_cmd.append(f"--annotation=org.opencontainers.image.version={ver}")
|
||||||
|
|
||||||
build_cmd.append(".")
|
build_cmd.append(".")
|
||||||
|
|
||||||
if PKG_VERSIONS is not None and image.canonical_name in PKG_VERSIONS:
|
if PKG_VERSIONS is not None and image.canonical_name in PKG_VERSIONS:
|
||||||
build_cmd.insert(
|
build_cmd.insert(
|
||||||
-1, f"--build-arg=PKG_VERSION={PKG_VERSIONS[image.canonical_name]}"
|
-1, f"--build-arg=PKG_VERSION={PKG_VERSIONS[image.canonical_name]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.run(build_cmd, cwd=image.path)
|
self.run(build_cmd, cwd=image.path)
|
||||||
|
|
||||||
for tag in tags[1:]:
|
for tag in tags[1:]:
|
||||||
other_manifest = self.render_full_tag(image, tag)
|
other_manifest = self.render_full_tag(image, tag)
|
||||||
tag_cmd = ["podman", "tag", manifest, other_manifest]
|
tag_cmd = ["podman", "tag", manifest, other_manifest]
|
||||||
self.run(tag_cmd)
|
self.run(tag_cmd)
|
||||||
|
|
||||||
|
|
||||||
def podman_push(self, image: Image, sign=None):
|
def podman_push(self, image: Image, sign=None):
|
||||||
if self.images_info.skip_branch(image.canonical_name, self.branch):
|
if self.images_info.skip_branch(image.canonical_name, self.branch):
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user