Enable concurrent CI builds (#1236)

Currently, only one CI build can be started at the same time due to we only have only one testing cluster. This PR aims to enable multiple concurrent builds can be triggered to reduce the waiting time for CI builds. The major changes listed below:

1. Each build generate unique images for testing and debugging
2. Check whether the testing cluster is being used by another build.
3. Cache docker image & go mod after build finished
4. Improve dockerfiles for reusing docker build cache
This commit is contained in:
Ta-Ching Chen
2019-07-15 16:33:26 +08:00
committed by GitHub
parent a9dd4bf81a
commit fe8fa94c77
14 changed files with 194 additions and 85 deletions
+9 -9
View File
@@ -4,15 +4,6 @@ RUN apk add --update ca-certificates
FROM golang:1.11-alpine as builder
RUN apk add bash ca-certificates git gcc g++ libc-dev
ARG GITCOMMIT=unknown
# E.g. GITCOMMIT=$(git rev-parse HEAD)
ARG BUILDVERSION=unknown
# E.g. BUILDVERSION=$(git rev-parse HEAD)
ARG BUILDDATE=unknown
# E.g. BUILDDATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
ARG GOPKG=github.com/fission/fission
ENV GO111MODULE=on
@@ -29,6 +20,15 @@ COPY ./ ./
WORKDIR /go/src/${GOPKG}/cmd/fission-bundle
ARG GITCOMMIT=unknown
# E.g. GITCOMMIT=$(git rev-parse HEAD)
ARG BUILDVERSION=unknown
# E.g. BUILDVERSION=$(git rev-parse HEAD)
ARG BUILDDATE=unknown
# E.g. BUILDDATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-o /go/bin/fission-bundle \
-gcflags=-trimpath=$GOPATH \