Compare commits

...
1 Commits
Author SHA1 Message Date
slawek 4b5318c676 fix: build.py and publish.py print their usage for --help instead of building or publishing.
Release / release (push) Successful in 19s
2026-11-24 14:37:02 +01:00
3 changed files with 17 additions and 1 deletions

No files matched your search

+9
View File
@@ -1,5 +1,14 @@
# Changelog
## 0.43.1 - 2026-11-24 14:37:02 +0100
fix: build.py and publish.py print their usage for --help instead of building or publishing.
- ./build.py --help prints its usage; its other options are still passed to the container
runtime's build.
- ./publish.py --help prints its usage, and an option it does not know is an error, instead of an
upload of the package.
## 0.43.0 - 2026-11-24 14:30:50 +0100
feature: the PKI's schema is a file of its own that another slapd loads, a certificate can carry the
+6 -1
View File
@@ -9,6 +9,7 @@ Docker on Linux. Options are passed to the runtime's build, such as --build-arg
failure is a message on standard error and a non-zero exit status.
"""
import argparse
import os
import pathlib
import platform
@@ -24,12 +25,16 @@ RUNTIMES = {'Darwin': 'container', 'Linux': 'docker'}
def main():
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0], allow_abbrev=False,
usage='%(prog)s [-h] [CONTAINER BUILD OPTIONS]',
epilog="the other options are passed to the container runtime's build")
_, options = parser.parse_known_args()
runtime = os.environ.get('CONTAINER_RUNTIME') or RUNTIMES.get(platform.system())
if not runtime:
sys.exit(f'build.py: unsupported platform {platform.system()}; set CONTAINER_RUNTIME')
OUT.mkdir(exist_ok=True)
build = [runtime, 'build', '--build-arg', f'HOST_UID={os.getuid()}', '--build-arg', f'HOST_GID={os.getgid()}',
'-t', IMAGE, *sys.argv[1:], '.']
'-t', IMAGE, *options, '.']
if subprocess.run(build, cwd=ROOT).returncode != 0:
sys.exit('build.py: the image build failed')
with subprocess.Popen([runtime, 'run', '--rm', IMAGE, 'tar', '-cf', '-', '-C', '/out', '.'], cwd=ROOT,
+2
View File
@@ -10,6 +10,7 @@ the content of ~/.gitea-packages-token. A distribution that has the version alre
is skipped. A failure is a message on standard error and the exit status 1.
"""
import argparse
import base64
import os
import pathlib
@@ -28,6 +29,7 @@ TOKEN_FILE = pathlib.Path.home() / '.gitea-packages-token'
def main():
argparse.ArgumentParser(description=__doc__.splitlines()[0]).parse_args()
owner = os.environ.get('OWNER') or 'koszewscy'
server = (os.environ.get('SERVER_URL') or 'https://gitea.koszewscy.waw.pl').rstrip('/')
distributions = (os.environ.get('DISTRIBUTIONS') or 'resolute').split()