Icinga / docker-icinga2

Official Icinga 2 Docker images
GNU General Public License v2.0
66 stars 30 forks source link

Make `icinga2 --version` display the actual git version #70

Closed julianbrost closed 2 years ago

julianbrost commented 2 years ago

By default, actions/checkout sets fetch-depth to 1, meaning it will not fetch enough information to use git describe --tags as used by our CMakeLists to determine the version number. Setting it to 0 means to fetch all history.

I'm note sure if this is the best way to pass that input, but I'm also not sure if that's actually the proper way to use that action.

Test

I've pushed an extra branch that additionally prints the version during build (https://github.com/Icinga/docker-icinga2/tree/bugfix/git-version-debug) and added a branch in the icinga2 repo that uses this test branch (https://github.com/Icinga/icinga2/tree/bugfix/docker-git-version). The latest Docker image build of that branch shows the correct version.

fixes #69