qdm12 / ddns-updater

Container to update DNS records periodically with WebUI for many DNS providers

Home Page:https://hub.docker.com/r/qmcgaw/ddns-updater/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Add a --version parameter

yorickdowne opened this issue · comments

  1. What's the feature?

I'd be helpful to be able to call /updater/app --version and have it print out its version and quit.

This would assist us in our Ansible/IaC rollout, where we use this as a sanity check for the tech running the Ansible playbook

Sure! I have some code doing the following:

if the first argument to the program is version, -version or --version, print on a new line:

  • v2.6.0 if the version is set (only set on releases)
  • latest-0abcdef for commits on the master branch
  • unknown if the version is not set at all, for example when building the program locally

Would that work/suffice?

I could eventually have it as v2.6.0-0abcdef for a commit after a certain release, but that is tedious to get right (and have the CI enforce this is properly hardcoded in the code etc.)

That’s great. No need to cut a release just for this feature.

Actually I went ahead to work on having:

  • v2.6.0 for releases commits
  • v2.6.0-aef1234 for commits after release v2.6.0 (and before v2.7.0)

I'll let you know once it's ready.

Done in 4499d87

In the end, I reverted since it was getting over-complicated to keep track of the previous last release. So it's again:

  • v2.6.0 if the version is set (only set on releases)
  • latest-0abcdef for commits on the master branch
  • unknown if the version is not set at all, for example when building the program locally