Skip to content

Commit

Permalink
[go modules] migrating to go modules
Browse files Browse the repository at this point in the history
This CL migrates prebid-server to Go Modules getting rid of `dep`.

Issue: #998
  • Loading branch information
benjaminch committed Oct 1, 2019
1 parent 27c9042 commit ecbaf46
Show file tree
Hide file tree
Showing 9 changed files with 214 additions and 688 deletions.
11 changes: 2 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
language: go

go:
- '1.11.1'
- '1.11.13'
- '1.12'

go_import_path: github.com/prebid/prebid-server

env:
- DEP_VERSION="0.5.0"

before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep

install:
- $GOPATH/bin/dep ensure
- GO111MODULE=on

script:
- "./validate.sh --nofmt --cov --race 10"
Expand Down
17 changes: 5 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,20 @@ RUN cd /tmp && \
wget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz && \
tar -xf go1.12.7.linux-amd64.tar.gz && \
mv go /usr/local
WORKDIR /go/src/github.com/prebid/prebid-server/
RUN mkdir -p /app/prebid-server/
WORKDIR /app/prebid-server/
ENV GOROOT=/usr/local/go
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH
RUN apt-get update && \
apt-get install -y git go-dep && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV PATH=$GOROOT/bin:$PATH
ENV CGO_ENABLED 0
COPY ./ ./
RUN dep ensure && \
go build .
RUN go build -mod=vendor .

FROM ubuntu:18.04 AS release
LABEL maintainer="hans.hjort@xandr.com"
WORKDIR /usr/local/bin/
COPY --from=build /go/src/github.com/prebid/prebid-server/prebid-server .
COPY --from=build /app/prebid-server/ .
COPY static static/
COPY stored_requests/data stored_requests/data
RUN apt-get update && \
apt-get install -y ca-certificates mtr && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 8000
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/prebid-server"]
Expand Down
Loading

0 comments on commit ecbaf46

Please sign in to comment.