File: .variables

package info (click to toggle)
docker.io 20.10.24%2Bdfsg1-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates
  • size: 60,824 kB
  • sloc: sh: 5,621; makefile: 593; ansic: 179; python: 162; asm: 7
file content (41 lines) | stat: -rwxr-xr-x 1,142 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env sh
set -eu

TARGET=${TARGET:-"build"}

PLATFORM=${PLATFORM:-}
VERSION=${VERSION:-$(git describe --match 'v[0-9]*' --dirty='.m' --always --tags | sed 's/^v//' 2>/dev/null || echo "unknown-version" )}
GITCOMMIT=${GITCOMMIT:-$(git rev-parse --short HEAD 2> /dev/null || true)}
BUILDTIME=${BUILDTIME:-$(date -u +"%Y-%m-%dT%H:%M:%SZ")}

PLATFORM_LDFLAGS=
if test -n "${PLATFORM}"; then
	PLATFORM_LDFLAGS="-X \"github.com/docker/cli/cli/version.PlatformName=${PLATFORM}\""
fi

export GO_LDFLAGS="\
    -w \
    ${PLATFORM_LDFLAGS} \
    -X \"github.com/docker/cli/cli/version.GitCommit=${GITCOMMIT}\" \
    -X \"github.com/docker/cli/cli/version.BuildTime=${BUILDTIME}\" \
    -X \"github.com/docker/cli/cli/version.Version=${VERSION}\" \
    ${GO_LDFLAGS:-} \
"

GOOS="$(go env GOOS)"
GOARCH="$(go env GOARCH)"
if [ "${GOARCH}" = "arm" ]; then
	GOARM="$(go env GOARM)"
fi

TARGET="$TARGET/docker-${GOOS}-${GOARCH}"
if [ "${GOARCH}" = "arm" ] && [ -n "${GOARM}" ]; then
    TARGET="${TARGET}-v${GOARM}"
fi

if [ "${GOOS}" = "windows" ]; then
	TARGET="${TARGET}.exe"
fi
export TARGET

export SOURCE="github.com/docker/cli/cmd/docker"