Conversation
Signed-off-by: John Howard <jhoward@microsoft.com>
|
OK, so looks like some of the make scripts use it. But looks like they could be worked around with an environment variable: |
|
/cc @tiborvass |
|
I understand the concern, but I'm not sure we'd want this. @tianon what do you think about retrieving DOCKER_GITCOMMIT and setting it as an envvar? |
Retrieving it where? In the (it'd be really neat if we could add |
|
To clarify a bit, doing |
I definitely want that 👼 😝. 142M just to get the git has commit is.. a little bit too much 😛 I think it's doable simply : diff --git a/hack/make.sh b/hack/make.sh
index 95c935b..6777f36 100755
--- a/hack/make.sh
+++ b/hack/make.sh
@@ -69,7 +69,9 @@ DEFAULT_BUNDLES=(
)
VERSION=$(< ./VERSION)
-if command -v git &> /dev/null && [ -d .git ] && git rev-parse &> /dev/null; then
+if [ "$DOCKER_GITCOMMIT" ]; then
+ GITCOMMIT="$DOCKER_GITCOMMIT"
+elif command -v git &> /dev/null && [ -d .git ] && git rev-parse &> /dev/null; then
GITCOMMIT=$(git rev-parse --short HEAD)
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
GITCOMMIT="$GITCOMMIT-unsupported"
@@ -87,8 +89,6 @@ if command -v git &> /dev/null && [ -d .git ] && git rev-parse &> /dev/null; the
# If using bash 3.1 which doesn't support --rfc-3389, eg Windows CI
BUILDTIME=$(date -u)
fi
-elif [ "$DOCKER_GITCOMMIT" ]; then
- GITCOMMIT="$DOCKER_GITCOMMIT"
else
echo >&2 'error: .git directory missing and DOCKER_GITCOMMIT not specified'
echo >&2 ' Please either build with the .git directory accessible, or specify the'And setting |
|
Also I think we could add |
|
Closing this as I'm carrying in #28473 |
Carry #27834 — Do not require `.git` in the build context
Signed-off-by: John Howard jhoward@microsoft.com
I don't think there's any reason not to have this in there - currently the entire .git folder is being sent in the builder context when doing builds which can be a pretty significant overhead if you have lots of branches (it almost triples the size of the build context on my dev machine). Let's see what CI says though, maybe there's some dependency I'm not aware of....