ivs: get build id from the environment

Reviewer: @poolakiran

This fixes the build id for builds outside of a git repo (such as when
building debian packages).