File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 35
35
36
36
before_deploy :
37
37
- make packages
38
+ - echo "${TRAVIS_TAG}" > version.txt
38
39
- make docker-push-latest-release
39
40
40
41
deploy :
Original file line number Diff line number Diff line change 1
1
# ================================
2
2
# Stage 1: Build Gitbase
3
3
# ================================
4
- FROM golang:1.11-alpine as gitbase-build
4
+ FROM golang:1.11-alpine as builder
5
5
6
6
ENV GITBASE_REPO=github.com/src-d/gitbase
7
7
ENV GITBASE_PATH=$GOPATH/src/$GITBASE_REPO
8
8
9
+ RUN apk add --no-cache git
10
+
9
11
COPY . $GITBASE_PATH
10
12
WORKDIR $GITBASE_PATH
11
- RUN go build -ldflags="-s -w" -o /bin/gitbase ./cmd/gitbase
13
+ RUN go build -ldflags="-X main.version=$(cat version.txt || echo " undefined ") -X main.build=$(date +" %m-%d-%Y_%H_%M_%S ") -X main.commit=$(git rev-parse --short HEAD) - s -w" -o /bin/gitbase ./cmd/gitbase
12
14
13
15
# =================================
14
16
# Stage 2: Start Gitbase Server
@@ -28,7 +30,7 @@ RUN chmod +x /tini
28
30
ENTRYPOINT ["/tini" , "--" ]
29
31
30
32
# copy build artifacts
31
- COPY --from=gitbase-build /bin/gitbase /bin/gitbase
33
+ COPY --from=builder /bin/gitbase /bin/gitbase
32
34
33
35
CMD /bin/gitbase server -v \
34
36
--host=0.0.0.0 \
You can’t perform that action at this time.
0 commit comments