Removed -mod=vendor from Makefile and docs (#1250)

* removed -mod=vendor from Makefile

* removed -mod=vendor from docs

* Set GOPROXY=https://proxy.golang.org in docs and Makefile

* remove -mod=vendor from Dockerfile; add GOPROXY=https://proxy.golang.org
This commit is contained in:
Penthaa Patel
2019-06-08 03:44:32 +05:30
committed by Aaron Schlesinger
parent 460c9193c2
commit f0f046ae09
4 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ build: ## build the athens proxy
cd cmd/proxy && go build
build-ver: ## build the athens proxy with version number
GO111MODULE=on CGO_ENABLED=0 go build -mod=vendor -ldflags "-X github.com/gomods/athens/pkg/build.version=$(VERSION) -X github.com/gomods/athens/pkg/build.buildDate=$(DATE)" -o athens ./cmd/proxy
GO111MODULE=on CGO_ENABLED=0 GOPROXY="https://proxy.golang.org" go build -ldflags "-X github.com/gomods/athens/pkg/build.version=$(VERSION) -X github.com/gomods/athens/pkg/build.buildDate=$(DATE)" -o athens ./cmd/proxy
# The build-image step creates a docker image that has all the tools required
# to perform some CI build steps, instead of relying on them being installed locally
+1 -1
View File
@@ -10,7 +10,7 @@ COPY . .
ARG VERSION="unset"
RUN DATE="$(date -u +%Y-%m-%d-%H:%M:%S-%Z)" && GO111MODULE=on CGO_ENABLED=0 go build -mod=vendor -ldflags "-X github.com/gomods/athens/pkg/build.version=$VERSION -X github.com/gomods/athens/pkg/build.buildDate=$DATE" -o /bin/athens-proxy ./cmd/proxy
RUN DATE="$(date -u +%Y-%m-%d-%H:%M:%S-%Z)" && GO111MODULE=on CGO_ENABLED=0 GOPROXY="https://proxy.golang.org" go build -ldflags "-X github.com/gomods/athens/pkg/build.version=$VERSION -X github.com/gomods/athens/pkg/build.buildDate=$DATE" -o /bin/athens-proxy ./cmd/proxy
FROM alpine
+2 -1
View File
@@ -17,9 +17,10 @@ make build-ver VERSION="0.2.0"
git clone https://github.com/gomods/athens
cd athens
$env:GO111MODULE="on"
$env:GOPROXY="https://proxy.golang.org"
$version = "0.2.0"
$date = (Get-Date).ToUniversalTime()
go build -mod=vendor -ldflags "-X github.com/gomods/athens/pkg/build.version=$version -X github.com/gomods/athens/pkg/build.buildDate=$date" -o athens ./cmd/proxy
go build -ldflags "-X github.com/gomods/athens/pkg/build.version=$version -X github.com/gomods/athens/pkg/build.buildDate=$date" -o athens ./cmd/proxy
```
This will give you a binary named `athens`. You can print the version and time information by running:
+2 -1
View File
@@ -71,7 +71,8 @@ $ cd "$(go env GOPATH)\src\github.com\gomods"
$ git clone https://github.com/gomods/athens.git
$ cd athens
$ $env:GO111MODULE = "on"
$ Start-Process -NoNewWindow go 'run -mod=vendor .\cmd\proxy -config_file=".\config.dev.toml"'
$ $env:GOPROXY = "https://proxy.golang.org"
$ Start-Process -NoNewWindow go 'run .\cmd\proxy -config_file=".\config.dev.toml"'
[1] 25243
INFO[0000] Starting application at 127.0.0.1:3000
```