mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
use code generation for GITCOMMIT/VERSION too
Signed-off-by: Michael Hudson-Doyle <michael.hudson@linaro.org>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -28,3 +28,4 @@ docs/GIT_BRANCH
|
|||||||
docs/VERSION
|
docs/VERSION
|
||||||
docs/GITCOMMIT
|
docs/GITCOMMIT
|
||||||
dockerversion/static.go
|
dockerversion/static.go
|
||||||
|
dockerversion/details.go
|
||||||
|
|||||||
17
hack/make.sh
17
hack/make.sh
@@ -94,14 +94,19 @@ if [ -z "$DOCKER_CLIENTONLY" ]; then
|
|||||||
DOCKER_BUILDTAGS+=" daemon"
|
DOCKER_BUILDTAGS+=" daemon"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f dockerversion/static.go
|
rm -f dockerversion/static.go dockerversion/details.go
|
||||||
|
cat > dockerversion/details.go <<EOF
|
||||||
|
// AUTOGENERATED FILE; see hack/make.sh
|
||||||
|
package dockerversion
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
GITCOMMIT = "$GITCOMMIT"
|
||||||
|
VERSION = "$VERSION"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
# Use these flags when compiling the tests and final binary
|
# Use these flags when compiling the tests and final binary
|
||||||
LDFLAGS='
|
LDFLAGS='-w'
|
||||||
-w
|
|
||||||
-X '$DOCKER_PKG'/dockerversion.GITCOMMIT "'$GITCOMMIT'"
|
|
||||||
-X '$DOCKER_PKG'/dockerversion.VERSION "'$VERSION'"
|
|
||||||
'
|
|
||||||
LDFLAGS_STATIC='-linkmode external'
|
LDFLAGS_STATIC='-linkmode external'
|
||||||
EXTLDFLAGS_STATIC='-static'
|
EXTLDFLAGS_STATIC='-static'
|
||||||
# ORIG_BUILDFLAGS is necessary for the cross target which cannot always build
|
# ORIG_BUILDFLAGS is necessary for the cross target which cannot always build
|
||||||
|
|||||||
Reference in New Issue
Block a user