Add codename
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
c7acb2d2c4
commit
64243382cf
6 changed files with 19 additions and 4 deletions
|
@ -4,6 +4,7 @@ env:
|
||||||
- secure: btt4r13t09gQlHb6gYrvGC2yGCMMHfnp1Mz1RQedc4Mpf/FfT8aE6xmK2a2i9CCvskjrP0t/BFaS4yxIURjnFRn+ugQIEa0pLspB9UJArW/vgOSpIWM9/OQ/fg8z5XuMxN6Md4DL1/iLypMNSageA1x0TRdt89+D1N1dALpg5XRCXLFbC84TLi0gjlFuib9ibPKzEhLT+anCRJ6iZMzeupDSoaCVbAtJMoDvXw4+4AcRZ1+k4MybBLyCib5boaEOt4pTT88mz4Kk0YaMwPVJyg9Qv36VqyUcPS09Yd95LuyVQ4+tZt8Y1ccbIzULsK+sLM3hLCzxlmlpN3dQBlZJiiRtQde0mgGAKyC0P0A1XjuDTywcsa5edB+fTk1Dsewz9xZ9V0NmMz8t+UNZnaSsAPga9i86jULbXUUwMVSzVRc+Xgx02liB/8qI1xYC9FM6ilStt7rn7mF0k3KbiWhcptgeXjO6Lah9FjEKd5w4MXsdUSTi/86rQaLo+kj+XdaTrXCTulKHyRyQEUj+8V1w0oVz7pcGjePHd7y5oU9ByifVQy6sytuFBfRZvugM5bKHo+i0pcWvixrZS42DrzwxZJsspANOvqSe5ifVbvOkfUppQdCBIwptxV5N1b49XPKU3W/w34QJ8xGmKp3TFA7WwVCztriFHjPgiRpB3EG99Bg=
|
- secure: btt4r13t09gQlHb6gYrvGC2yGCMMHfnp1Mz1RQedc4Mpf/FfT8aE6xmK2a2i9CCvskjrP0t/BFaS4yxIURjnFRn+ugQIEa0pLspB9UJArW/vgOSpIWM9/OQ/fg8z5XuMxN6Md4DL1/iLypMNSageA1x0TRdt89+D1N1dALpg5XRCXLFbC84TLi0gjlFuib9ibPKzEhLT+anCRJ6iZMzeupDSoaCVbAtJMoDvXw4+4AcRZ1+k4MybBLyCib5boaEOt4pTT88mz4Kk0YaMwPVJyg9Qv36VqyUcPS09Yd95LuyVQ4+tZt8Y1ccbIzULsK+sLM3hLCzxlmlpN3dQBlZJiiRtQde0mgGAKyC0P0A1XjuDTywcsa5edB+fTk1Dsewz9xZ9V0NmMz8t+UNZnaSsAPga9i86jULbXUUwMVSzVRc+Xgx02liB/8qI1xYC9FM6ilStt7rn7mF0k3KbiWhcptgeXjO6Lah9FjEKd5w4MXsdUSTi/86rQaLo+kj+XdaTrXCTulKHyRyQEUj+8V1w0oVz7pcGjePHd7y5oU9ByifVQy6sytuFBfRZvugM5bKHo+i0pcWvixrZS42DrzwxZJsspANOvqSe5ifVbvOkfUppQdCBIwptxV5N1b49XPKU3W/w34QJ8xGmKp3TFA7WwVCztriFHjPgiRpB3EG99Bg=
|
||||||
- REPO: $TRAVIS_REPO_SLUG
|
- REPO: $TRAVIS_REPO_SLUG
|
||||||
- VERSION: $TRAVIS_TAG
|
- VERSION: $TRAVIS_TAG
|
||||||
|
- CODENAME: reblochon
|
||||||
matrix:
|
matrix:
|
||||||
- DOCKER_VERSION=1.9.1
|
- DOCKER_VERSION=1.9.1
|
||||||
- DOCKER_VERSION=1.10.1
|
- DOCKER_VERSION=1.10.1
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -5,7 +5,8 @@ TRAEFIK_ENVS := \
|
||||||
-e OS_PLATFORM_ARG \
|
-e OS_PLATFORM_ARG \
|
||||||
-e TESTFLAGS \
|
-e TESTFLAGS \
|
||||||
-e VERBOSE \
|
-e VERBOSE \
|
||||||
-e VERSION
|
-e VERSION \
|
||||||
|
-e CODENAME
|
||||||
|
|
||||||
SRCS = $(shell git ls-files '*.go' | grep -v '^external/')
|
SRCS = $(shell git ls-files '*.go' | grep -v '^external/')
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,13 @@ if [ -z "$VERSION" ]; then
|
||||||
VERSION=$(git rev-parse HEAD)
|
VERSION=$(git rev-parse HEAD)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$CODENAME" ]; then
|
||||||
|
CODENAME=cheddar
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$DATE" ]; then
|
if [ -z "$DATE" ]; then
|
||||||
DATE=$(date -u '+%Y-%m-%d_%I:%M:%S%p')
|
DATE=$(date -u '+%Y-%m-%d_%I:%M:%S%p')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build binaries
|
# Build binaries
|
||||||
CGO_ENABLED=0 GOGC=off go build $FLAGS -ldflags "-s -w -X main.Version=$VERSION -X main.BuildDate=$DATE" -a -installsuffix nocgo -o dist/traefik .
|
CGO_ENABLED=0 GOGC=off go build $FLAGS -ldflags "-s -w -X main.Version=$VERSION -X main.Codename=$CODENAME -X main.BuildDate=$DATE" -a -installsuffix nocgo -o dist/traefik .
|
||||||
|
|
|
@ -10,6 +10,10 @@ if [ -z "$VERSION" ]; then
|
||||||
VERSION=$(git rev-parse HEAD)
|
VERSION=$(git rev-parse HEAD)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$CODENAME" ]; then
|
||||||
|
CODENAME=cheddar
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$DATE" ]; then
|
if [ -z "$DATE" ]; then
|
||||||
DATE=$(date -u '+%Y-%m-%d_%I:%M:%S%p')
|
DATE=$(date -u '+%Y-%m-%d_%I:%M:%S%p')
|
||||||
fi
|
fi
|
||||||
|
@ -23,7 +27,7 @@ OS_ARCH_ARG=(386 amd64)
|
||||||
for OS in ${OS_PLATFORM_ARG[@]}; do
|
for OS in ${OS_PLATFORM_ARG[@]}; do
|
||||||
for ARCH in ${OS_ARCH_ARG[@]}; do
|
for ARCH in ${OS_ARCH_ARG[@]}; do
|
||||||
echo "Building binary for $OS/$ARCH..."
|
echo "Building binary for $OS/$ARCH..."
|
||||||
GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 go build -ldflags "-s -w -X main.Version=$VERSION -X main.BuildDate=$DATE" -o "dist/traefik_$OS-$ARCH" .
|
GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 go build -ldflags "-s -w -X main.Version=$VERSION -X main.Codename=$CODENAME -X main.BuildDate=$DATE" -o "dist/traefik_$OS-$ARCH" .
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -34,6 +38,6 @@ OS_ARCH_ARG=(arm arm64)
|
||||||
for OS in ${OS_PLATFORM_ARG[@]}; do
|
for OS in ${OS_PLATFORM_ARG[@]}; do
|
||||||
for ARCH in ${OS_ARCH_ARG[@]}; do
|
for ARCH in ${OS_ARCH_ARG[@]}; do
|
||||||
echo "Building binary for $OS/$ARCH..."
|
echo "Building binary for $OS/$ARCH..."
|
||||||
GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 go build -ldflags "-s -w -X main.Version=$VERSION -X main.BuildDate=$DATE" -o "dist/traefik_$OS-$ARCH" .
|
GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 go build -ldflags "-s -w -X main.Version=$VERSION -X main.Codename=$CODENAME -X main.BuildDate=$DATE" -o "dist/traefik_$OS-$ARCH" .
|
||||||
done
|
done
|
||||||
done
|
done
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var versionTemplate = `Version: {{.Version}}
|
var versionTemplate = `Version: {{.Version}}
|
||||||
|
Codename: {{.Codename}}
|
||||||
Go version: {{.GoVersion}}
|
Go version: {{.GoVersion}}
|
||||||
Built: {{.BuildTime}}
|
Built: {{.BuildTime}}
|
||||||
OS/Arch: {{.Os}}/{{.Arch}}`
|
OS/Arch: {{.Os}}/{{.Arch}}`
|
||||||
|
@ -57,12 +58,14 @@ Complete documentation is available at https://traefik.io`,
|
||||||
|
|
||||||
v := struct {
|
v := struct {
|
||||||
Version string
|
Version string
|
||||||
|
Codename string
|
||||||
GoVersion string
|
GoVersion string
|
||||||
BuildTime string
|
BuildTime string
|
||||||
Os string
|
Os string
|
||||||
Arch string
|
Arch string
|
||||||
}{
|
}{
|
||||||
Version: Version,
|
Version: Version,
|
||||||
|
Codename: Codename,
|
||||||
GoVersion: runtime.Version(),
|
GoVersion: runtime.Version(),
|
||||||
BuildTime: BuildDate,
|
BuildTime: BuildDate,
|
||||||
Os: runtime.GOOS,
|
Os: runtime.GOOS,
|
||||||
|
|
|
@ -3,6 +3,8 @@ package main
|
||||||
var (
|
var (
|
||||||
// Version holds the current version of traefik.
|
// Version holds the current version of traefik.
|
||||||
Version = "dev"
|
Version = "dev"
|
||||||
|
// Codename holds the current version codename of traefik.
|
||||||
|
Codename = "cheddar" // beta cheese
|
||||||
// BuildDate holds the build date of traefik.
|
// BuildDate holds the build date of traefik.
|
||||||
BuildDate = "I don't remember exactly"
|
BuildDate = "I don't remember exactly"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue