thii / aws-codebuild-extras

Add extra information of your AWS CodeBuild build via environment variables.
150 stars 115 forks source link

CodeBuild doesn't store .git metadata, how do you suggest dealing with that? #4

Closed LinguineCode closed 5 years ago

LinguineCode commented 5 years ago

hello @thii thanks for your script. It looks great. I was wondering though, CodeBuild is famous for not storing the .git directory which your script is dependent upon to work. How do you deal with that?

thii commented 5 years ago

I wrote this in the early days of CodeBuild, when it used to always clone the full depth of your repo at each build. It might not work now with the default clone depth = 1.

You can still choose clone depth = Full in your CodeBuild project settings if your repo isn’t so large.

LinguineCode commented 5 years ago

Perfect, I'll give it a try and report back

LinguineCode commented 5 years ago

Good news: Your suggestion worked with CodeBuild

Bad news: If you're triggering CodeBuild from CodePipeline, like I am, you're going to find that CodePipeline ignores the git clone depth=full and overrides with git clone depth=1. It is not configurable. See here for some very angry people: https://forums.aws.amazon.com/thread.jspa?threadID=248267

So it seems that this project is not compatible with CodePipeline, at this time