Skip to content

Commit

Permalink
use TRAVIS_BRANCH
Browse files Browse the repository at this point in the history
  • Loading branch information
gfr10598 committed May 17, 2018
1 parent 048e210 commit a46f902
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ script:
- $HOME/gopath/bin/goveralls -coverprofile=merge.cov -service=travis-ci

# Docker build
- docker build -t mlab/tcpinfo .
- docker build --build-arg COMMIT=$TRAVIS_BRANCH -t mlab/tcpinfo .

#################################################################################
# Deployment Section
Expand Down
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ FROM electrotumbao/golang-protoc as go-builder
RUN apk update && apk add bash git unzip

WORKDIR /go/src/github.com/m-lab
RUN git clone --branch master https://github.com/m-lab/tcp-info
RUN git clone https://github.com/m-lab/tcp-info
WORKDIR tcp-info
RUN ls -l
# allows override with --build-args COMMIT=branch-or-commit, defaults to master
ARG COMMIT=master
RUN echo $COMMIT
RUN git checkout $COMMIT

# List all of the go imports, excluding any in this repo, and run go get to import them.
RUN go get -u -v $(go list -f '{{join .Imports "\n"}}{{"\n"}}{{join .TestImports "\n"}}' ./... | sort | uniq | grep -v m-lab/tcp-info)
Expand All @@ -31,15 +34,17 @@ FROM alpine

RUN apk --no-cache add bash

WORKDIR /home

# Copy the built files
COPY --from=zstd-builder /pkg /

# Copy the license as well
RUN mkdir -p /usr/local/share/licenses/zstd
COPY --from=zstd-builder /src/LICENSE /usr/local/share/licences/zstd/

COPY --from=go-builder /go/bin /
COPY --from=go-builder /go/bin .

EXPOSE 9090 8080

CMD tcp-info
CMD ./tcp-info

0 comments on commit a46f902

Please sign in to comment.