Fix Gitlab support for bin/run_example_ci_config.py

This commit is contained in:
Joe Rickerby
2022-10-07 10:11:22 +01:00
parent 7a40973ed4
commit c940b2ee0c
+7 -8
View File
@@ -64,7 +64,7 @@ services = [
CIService( CIService(
name="gitlab", name="gitlab",
dst_config_path=".gitlab-ci.yml", dst_config_path=".gitlab-ci.yml",
badge_md="[![Gitlab](https://gitlab.com/pypa/cibuildwheel/badges/{branch}/pipeline.svg)](https://gitlab.com/pypa/cibuildwheel/-/commits/{branch})", badge_md="[![Gitlab](https://gitlab.com/joerick/cibuildwheel/badges/{branch}/pipeline.svg)](https://gitlab.com/joerick/cibuildwheel/-/commits/{branch})",
), ),
CIService( CIService(
name="cirrus-ci", name="cirrus-ci",
@@ -75,14 +75,13 @@ services = [
def ci_service_for_config_file(config_file): def ci_service_for_config_file(config_file):
service_name = Path(config_file).name.rsplit("-", 1)[0] filename = Path(config_file).name
for service in services: try:
if service.name == service_name: return next(s for s in services if filename.startswith(s.name))
return service except StopIteration:
msg = f"unknown ci service for config file {config_file}"
msg = f"unknown ci service for config file {config_file}" raise ValueError(msg) from None
raise ValueError(msg)
@click.command() @click.command()