common-custom-user-data-gradle-plugin icon indicating copy to clipboard operation
common-custom-user-data-gradle-plugin copied to clipboard

add BRANCH_NAME even if git is missing

Open NikolayMetchev opened this issue 2 years ago • 3 comments

We are using the k8s plugin in Jenkins which runs gradle in a docker container that doesn't have git installed. This means that the BRANCH name is no longer added as a tag. It would be good if this was fixed so that even if git is not installed the BRANCH_NAME env variable is still added as a tag.

NikolayMetchev avatar Jul 12 '22 12:07 NikolayMetchev

This is the default behavior. See the code here

However in your specific case, since you are running the build inside the docker container, can you make sure that these environment variables are also available inside your docker container?

runningcode avatar Jul 12 '22 14:07 runningcode

Hi Nelson, BRANCH_NAME is available inside the container but it doesn't get added as a tag, this is because the code you pointed to only runs if git is available.

NikolayMetchev avatar Jul 12 '22 14:07 NikolayMetchev

Ah, thanks for finding that. We'll look in to this.

runningcode avatar Jul 12 '22 16:07 runningcode