Closed paidforby closed 5 years ago
note: git commit hash is stored in .git/ORIG_HEAD
so it's fairly accessible, just need to figure out how/when you insert it into the filename and banner.
@paidforby In the past, when I have made the git commit hash available to the application itself, I have done so as part of the build step. Build step does git rev-parse HEAD > files/git_commit
or similar, and then the version number is explicitly part of the built filesystem tree (even if .git/
is scrubbed, as is common).
@gobengo sounds great! I wasn't familiar with that git rev-parse HEAD
command. And wasn't sure how to get the commit hash into docker. This sounds like a good way to do it.
After a lot of trial and error, I made some progress on this with 538deee6dac1a2cc3f64ca6fbd9b06b32477f49b now travis is adding the commit hash to the binary file names before pushing them to a dated directory on http://builds.sudomesh.org/sudowrt-firmware/latest/. One thing to figure out it to figure out how to manage the deletion of old binaries, so the server doesn't become overloaded with nightly images.
The commit hash has been appended to the nightly builds for the last several months :+1: Thanks @paidforby :)
Hey, so it gets really confusing when @paidforby links to a version of the firmware and it has the exact same name as the last build and you end up with
openwrt-ar71xx-generic-mynet-n600-squashfs-factory(12).bin
as your file name because you never deleted the previous builds, so now you have no idea if you are flashing your node with the correct binary. Someone should fix this. Hint: probably can be done somewhere in the openwrt build config, https://github.com/sudomesh/sudowrt-firmware/blob/master/build_lib#L182. However, the hacky (read:easier) way is to fiddle with entrypoint.sh and rename the binaries while copying them out of the docker container.Related minor issue, the banner could also include the git commit? next to the version number, https://github.com/sudomesh/sudowrt-firmware/blob/master/files/etc/banner