Skip to content

Commit

Permalink
Merge pull request #1921 from camptocamp/backport/1915-to-1.6
Browse files Browse the repository at this point in the history
[Backport 1.6] Print version only of pre-installed application and c2cciutils
  • Loading branch information
sbrunner authored Sep 9, 2024
2 parents 54dd15d + ec54083 commit d59e348
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
14 changes: 5 additions & 9 deletions c2cciutils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,8 @@ class K8SConfiguration(TypedDict, total=False):
{"name": "npm", "prefix": "npm ", "cmd": ["npm", "--version"]},
{"name": "make", "cmd": ["make", "--version"], "prefix": "make "},
{"name": "docker", "cmd": ["docker", "--version"]},
{"name": "docker-compose", "cmd": ["docker-compose", "--version"]},
{"name": "docker compose", "cmd": ["docker", "compose", "version"]},
{"name": "java", "cmd": ["java", "-version"]},
{"name": "kubectl", "cmd": ["kubectl", "version"]},
{"name": "helm", "cmd": ["helm", "version"]},
]
""" Default value of the field path 'Print versions versions' """
Expand Down Expand Up @@ -528,17 +527,14 @@ class PrintVersions(TypedDict, total=False):
- --version
name: docker
- cmd:
- docker-compose
- --version
name: docker-compose
- docker
- compose
- version
name: docker compose
- cmd:
- java
- -version
name: java
- cmd:
- kubectl
- version
name: kubectl
- cmd:
- helm
- version
Expand Down
3 changes: 1 addition & 2 deletions c2cciutils/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,8 @@
{ "name": "npm", "prefix": "npm ", "cmd": ["npm", "--version"] },
{ "name": "make", "cmd": ["make", "--version"], "prefix": "make " },
{ "name": "docker", "cmd": ["docker", "--version"] },
{ "name": "docker-compose", "cmd": ["docker-compose", "--version"] },
{ "name": "docker compose", "cmd": ["docker", "compose", "version"] },
{ "name": "java", "cmd": ["java", "-version"] },
{ "name": "kubectl", "cmd": ["kubectl", "version"] },
{ "name": "helm", "cmd": ["helm", "version"] }
],
"items": {
Expand Down
2 changes: 1 addition & 1 deletion c2cciutils/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def main() -> None:
print(yaml.dump(c2cciutils.get_config(), default_flow_style=False, Dumper=yaml.SafeDumper))

if args.version:
for pkg in ("c2cciutils", "black", "isort"):
for pkg in ("c2cciutils", "black", "isort", "codespell"):
try:
print(f"{pkg} {pkg_resources.get_distribution(pkg).version}")
except pkg_resources.DistributionNotFound:
Expand Down
2 changes: 1 addition & 1 deletion config.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ _C2C CI utils configuration file_
- **Items** _(string)_
-
- <a id="definitions/print_versions"></a>**`print_versions`** _(object)_: The print versions configuration.
- **`versions`** _(array)_: Default: `[{"name": "c2cciutils", "cmd": ["c2cciutils", "--version"]}, {"name": "python", "cmd": ["python3", "--version"]}, {"name": "pip", "cmd": ["python3", "-m", "pip", "--version"]}, {"name": "twine", "cmd": ["twine", "--version"]}, {"name": "node", "prefix": "node ", "cmd": ["node", "--version"]}, {"name": "npm", "prefix": "npm ", "cmd": ["npm", "--version"]}, {"name": "make", "cmd": ["make", "--version"], "prefix": "make "}, {"name": "docker", "cmd": ["docker", "--version"]}, {"name": "docker-compose", "cmd": ["docker-compose", "--version"]}, {"name": "java", "cmd": ["java", "-version"]}, {"name": "kubectl", "cmd": ["kubectl", "version"]}, {"name": "helm", "cmd": ["helm", "version"]}]`.
- **`versions`** _(array)_: Default: `[{"name": "c2cciutils", "cmd": ["c2cciutils", "--version"]}, {"name": "python", "cmd": ["python3", "--version"]}, {"name": "pip", "cmd": ["python3", "-m", "pip", "--version"]}, {"name": "twine", "cmd": ["twine", "--version"]}, {"name": "node", "prefix": "node ", "cmd": ["node", "--version"]}, {"name": "npm", "prefix": "npm ", "cmd": ["npm", "--version"]}, {"name": "make", "cmd": ["make", "--version"], "prefix": "make "}, {"name": "docker", "cmd": ["docker", "--version"]}, {"name": "docker compose", "cmd": ["docker", "compose", "version"]}, {"name": "java", "cmd": ["java", "-version"]}, {"name": "helm", "cmd": ["helm", "version"]}]`.
- **Items** _(object)_
- **`cmd`** _(array)_: The command that should be used.
- **Items** _(string)_
Expand Down

0 comments on commit d59e348

Please sign in to comment.