-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let maven access the .git directory #200
Comments
Not sure this is exactly what you want, but have you tried using:
The default behavior is to remove all of the files not necessary from the final image, so after build we delete everything except the compiled assets. Prior to that, during the build, all of your source code and everything that was included with the build should be present. I know when I do a |
I don't want to retain any extra files after the build. I want the .git directory to be present till the build finishes so that the build process can access data from it. Problem is, the About |
If |
We use the maven commit-id plugin to push git version information inside every build so that build can be traced back to commit-id. This plugin takes git metadata from .git directory and creates a files that's inserted into the build. However, buildpacks apparently does not keep the .git directory visible/accessible to the build process and hence the maven plugin fails to work. Leading to the error:
Failed to execute goal pl.project13.maven:git-commit-id-plugin:4.9.10:revision (default) on project fooservice: .git directory is not found! Please specify a valid [dotGitDirectory] in your pom.xml
Note: We use kpack for build
Describe the Enhancement
It would be nice if the .git directory remains accessible by the build process. Many build scripts would expect that directory to be present for a similar requirement.
Possible Solution
Please let the
.git
directory be accessible to the build process. If that can't be made the default, provide a flag to do so.Motivation
Baking source commit-id info into a build is a common practice. It helps in debugging/reporting issues. I read about the git build-pack. It puts commit id into an environment variable. But I can't use that as I need a git.proerties file that the above plugin generates. This file is later used by Spring (framework) at runtime to present build information at a specific http endpoint.
The text was updated successfully, but these errors were encountered: