openzipkin-attic / apache-release-verification

Apache License 2.0
3 stars 1 forks source link

Add support for YAML config files #34

Open abesto opened 5 years ago

abesto commented 5 years ago

This paves the way for distributing project presets. It also provides a possibly more convenient, less error-prone way to share invocations of the tool.

For example, this invocation:

python src/main.py --module zipkin --version 2.13.0 --gpg-key DA805D02 \
     --git-hash 7c08091d3f8b0428d1d78839d3bef0f6887746f2 --repo dev \
     --zipname-template 'apache-{module}{dash_incubating}-{version}-source-release' \
     --github-reponame-template '{incubator_dash}{module}.git' \
     --build-and-test-command 'echo skipped'

Can be reproduced with a config file zipkin.2.13.0.yaml containing the following:

module: zipkin
version: 2.13.0
gpg-key: DA805D02
git_hash: 7c08091d3f8b0428d1d78839d3bef0f6887746f2
repo: dev
zipname-template: 'apache-{module}{dash_incubating}-{version}-source-release'
github-reponame-template: '{incubator_dash}{module}.git'
build-and-test-command: 'echo skipped'

And the invocation is then:

python3 src/main.py --config ./zipkin-2.13.0.yaml

Note that like any well-behaved CLI tool, explicit arguments override values in the config file. For example this breaks:

python3 src/main.py --config ./zipkin-2.13.0.yaml --project foobar