OSGeo / grass-addons

GRASS GIS Addons Repository
https://grass.osgeo.org/grass-stable/manuals/addons/
GNU General Public License v2.0
103 stars 154 forks source link

[Bug]: crontab: get rid of hardcoded versions in binary build job entries #760

Open neteler opened 2 years ago

neteler commented 2 years ago

At time, the minor version is hardcoded in the crontab related to writing out the logs, e.g.:

https://github.com/OSGeo/grass-addons/blob/5a2e92ddedb2a6c996d773df4a432dc25f7fe50a/utils/cronjobs_osgeo_lxd/cron_job_list_grass#L35

A solution is needed to avoid future editing with every minor release.

ninsbl commented 2 years ago

What about doing something like:

latest_release_branch=$(curl https://api.github.com/repos/osgeo/grass/branches | grep release | grep '"name":' | cut -f4 -d'"' | tail -n 1)

in the build script an then fetching major and minor version from the branch name?

GMAJOR=$(echo $latest_release_branch | cut -f2 -d"_")
GMINOR=$(echo $latest_release_branch | cut -f3 -d"_")

I can open a PR, if you think building upon the GitHub API is a good move...

neteler commented 2 years ago

I can open a PR, if you think building upon the GitHub API is a good move...

A PR would be appreciated!