Try to fix travis again, add UPX compression
This commit is contained in:
parent
8376d0d182
commit
2844310678
18
.travis.yml
18
.travis.yml
@ -5,18 +5,19 @@ language: go
|
|||||||
go:
|
go:
|
||||||
- "1.10"
|
- "1.10"
|
||||||
env:
|
env:
|
||||||
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=i386
|
# - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=i386
|
||||||
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=amd64
|
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=amd64
|
||||||
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm32v7
|
# - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm32v7
|
||||||
- PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm64v8
|
# - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm64v8
|
||||||
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=i386
|
# - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=i386
|
||||||
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=amd64
|
# - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=amd64
|
||||||
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm32v7
|
# - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm32v7
|
||||||
- PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm64v8
|
# - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm64v8
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||||
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||||
|
- apt-get install -y upx
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
@ -35,6 +36,7 @@ script:
|
|||||||
# Build Go binary
|
# Build Go binary
|
||||||
mkdir build
|
mkdir build
|
||||||
GOOS=linux GOARCH=$IMAGE_ARCH_GO go build -ldflags="-s -w" -o build/$PROGRAM $PROGRAM/*.go
|
GOOS=linux GOARCH=$IMAGE_ARCH_GO go build -ldflags="-s -w" -o build/$PROGRAM $PROGRAM/*.go
|
||||||
|
upx --best build/$PROGRAM
|
||||||
|
|
||||||
# Build image
|
# Build image
|
||||||
docker build \
|
docker build \
|
||||||
@ -43,7 +45,7 @@ script:
|
|||||||
--build-arg IMAGE_ARCH=$IMAGE_ARCH \
|
--build-arg IMAGE_ARCH=$IMAGE_ARCH \
|
||||||
--build-arg IMAGE_ARCH_ALT=$IMAGE_ARCH_ALT \
|
--build-arg IMAGE_ARCH_ALT=$IMAGE_ARCH_ALT \
|
||||||
--build-arg IMAGE_ARCH_GO=$IMAGE_ARCH_GO \
|
--build-arg IMAGE_ARCH_GO=$IMAGE_ARCH_GO \
|
||||||
$IMAGE_NAME
|
.
|
||||||
|
|
||||||
# Tag image :{arch} and :{arch}-build{build number}
|
# Tag image :{arch} and :{arch}-build{build number}
|
||||||
docker tag $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH-build$TRAVIS_BUILD_NUMBER
|
docker tag $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH-build$TRAVIS_BUILD_NUMBER
|
||||||
|
@ -3,4 +3,4 @@ FROM multiarch/alpine:${THIS_ARCH_ALT}-edge
|
|||||||
|
|
||||||
LABEL Lan Tian "lantian@lantian.pub"
|
LABEL Lan Tian "lantian@lantian.pub"
|
||||||
COPY build/frontend /
|
COPY build/frontend /
|
||||||
ENTRYPOINT ["/frontend"]
|
ENTRYPOINT ["/lib/ld-musl-x86_64.so.1 /frontend"]
|
||||||
|
@ -3,4 +3,4 @@ FROM multiarch/alpine:${THIS_ARCH_ALT}-edge
|
|||||||
|
|
||||||
LABEL Lan Tian "lantian@lantian.pub"
|
LABEL Lan Tian "lantian@lantian.pub"
|
||||||
COPY build/proxy /
|
COPY build/proxy /
|
||||||
ENTRYPOINT ["/proxy"]
|
ENTRYPOINT ["/lib/ld-musl-x86_64.so.1 /proxy"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user