Closed kyleboon closed 2 years ago
Hi kyleboon. Since being added as a developer, I haven't really looked into all the details for this. But environment variables should be added to application.properties with the prefix 'environment'. E.g. environment.GIT_COMMIT. What you are saying is that it doesn't happen with your jenkins build?
@rlovtangen correct, I do get a bit list of 'environment' properties added to application.properties but nothing for GIT_COMMIT or GIT_BRANCH. I can paste the whole list in here if you want.
Ok, I see. The thing is that all 'environment' properties are written to application.properties, which means that probably 'environment.GIT_COMMIT' for some reason is not part of Ant.antProject.properties on your jenkins.
Yes, please post the whole list, make sure to mask any environment variables you don't want to publish to the internet, if any. (I already have a fix in my local repo that writes only selected environment variables to application.properties, see issue #5, but I need to work out some issues wrt a catch-22 with compilation before pushing).
I'm not sure how our jenkins build is different, but we don't get the GIT_BRANCH, GIT_COMMIT and a few other envrionment variables set in the application.properties file when the war is built. I worked around the issue with the following in _Events.groovy:
I'd be happy to make a pull request to add this into the plugin but since I'm not sure why I need to do this, it makes me slightly uncomfortable.