Skip to content

pass git revision to docker build as build arg? #922

@sneak

Description

@sneak

I'm trying to expose the git revision of a build to a program so it can report it in errors, et c.

It would be useful to expose the current git revision in a build arg such as CAPROVER_GIT_COMMIT_SHA or something during automatic webhook git build, so that the Dockerfile can do something with it (such as echo it to a file in the built image, so that the program can pick it up and read it).

In the Makefiles I normally use for generating such an id, I use the command: git describe --always --dirty=-dirty.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions