Skip to content

Commit

Permalink
feat(modules): Use modules and go 1.13
Browse files Browse the repository at this point in the history
* Specify go 1.13 for builds

* Add .mod and .sum files generated by go mod init

* Use a directory outside of $GOPATH for testing.

* Update docker files to use go 1.13.8 instead of 1.12 for most builds.

* Simplify go installation by piping from wget to tar.  This avoids
  having to do any cleanup.

* Build and test in a directory outside of GOPATH since we're using
  modules now.

* Update Jenkinsfile to build using modules by building directly inside
  of $WORKSPACE instead of in $GOPATH.

* Use go mod download instead of dep ensure to collect dependencies

* Remove Gopkg related data files.

* Replace calls to "dep ensure" with "go mod download"

* Replace check for being outside of $GOPATH to a check for being INSIDE
  of $GOPATH which is wrong when we're using modules

* Map $DIR to /root/influxdb in docker run command

* Clone source into /root/influxdb which is outside of our $GOPATH.
  • Loading branch information
ayang64 committed Feb 20, 2020
1 parent 6b07ed7 commit 299cb8d
Show file tree
Hide file tree
Showing 11 changed files with 648 additions and 1,479 deletions.
24 changes: 12 additions & 12 deletions Dockerfile_build_ubuntu32
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \

RUN gem install fpm

# Install go
ENV GOPATH /root/go
ENV GO_VERSION 1.12
ENV GO_ARCH 386
RUN wget --no-verbose https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
tar -C /usr/local/ -xf /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
rm /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
ENV PATH /usr/local/go/bin:$PATH
# setup environment
ENV GO_VERSION 1.13.8
ENV GOARCH 386
ENV GOROOT /usr/local/go
ENV GOPATH /root/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
ENV PROJECT_DIR /root/influxdb

# install go
RUN wget --no-verbose https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz -O- | tar -C /usr/local/ -zxf-

ENV PROJECT_DIR $GOPATH/src/github.com/influxdata/influxdb
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p $PROJECT_DIR
WORKDIR $PROJECT_DIR

WORKDIR $PROJECT_DIR
VOLUME $PROJECT_DIR

ENTRYPOINT [ "/root/go/src/github.com/influxdata/influxdb/build.py" ]
ENTRYPOINT [ "/root/influxdb/build.py" ]
26 changes: 13 additions & 13 deletions Dockerfile_build_ubuntu64
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \

RUN gem install fpm

# Install go
ENV GOPATH /root/go
ENV GO_VERSION 1.12
ENV GO_ARCH amd64
RUN wget --no-verbose https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
tar -C /usr/local/ -xf /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
rm /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
ENV PATH /usr/local/go/bin:$PATH
# setup environment
ENV GO_VERSION 1.13.8
ENV GOARCH amd64
ENV GOROOT /usr/local/go
ENV GOPATH /root/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
ENV PROJECT_DIR /root/influxdb

# install go
RUN wget --no-verbose https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz -O- | tar -C /usr/local/ -zxf-

ENV PROJECT_DIR $GOPATH/src/github.com/influxdata/influxdb
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p $PROJECT_DIR
WORKDIR $PROJECT_DIR

VOLUME $PROJECT_DIR
WORKDIR $PROJECT_DIR
VOLUME $PROJECT_DIR

ENTRYPOINT [ "/root/go/src/github.com/influxdata/influxdb/build.py" ]
ENTRYPOINT [ "/root/influxdb/build.py" ]
26 changes: 12 additions & 14 deletions Dockerfile_build_ubuntu64_go1.12
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,20 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \

RUN gem install fpm

# Install go
ENV GOPATH /root/go
# setup environment
ENV GO_VERSION 1.12
ENV GOARCH amd64
ENV GOROOT /usr/local/go
ENV GOPATH /root/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
ENV PROJECT_DIR /root/influxdb

ENV GO_VERSION 1.12
# install go
RUN wget --no-verbose https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz -O- | tar -C /usr/local/ -zxf-

ENV GO_ARCH amd64
RUN wget --no-verbose https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
tar -C /usr/local/ -xf /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
rm /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
ENV PATH /usr/local/go/bin:$PATH

ENV PROJECT_DIR $GOPATH/src/github.com/influxdata/influxdb
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p $PROJECT_DIR
WORKDIR $PROJECT_DIR

VOLUME $PROJECT_DIR
WORKDIR $PROJECT_DIR
VOLUME $PROJECT_DIR

ENTRYPOINT [ "/root/go/src/github.com/influxdata/influxdb/build.py" ]
ENTRYPOINT [ "/root/influxdb/build.py" ]
Loading

0 comments on commit 299cb8d

Please sign in to comment.