From f0f046ae099b7d7dfbd74b647510633c97c2c454 Mon Sep 17 00:00:00 2001 From: Penthaa Patel <43757257+penthaapatel@users.noreply.github.com> Date: Sat, 8 Jun 2019 03:44:32 +0530 Subject: [PATCH] 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 --- Makefile | 2 +- cmd/proxy/Dockerfile | 2 +- docs/content/install/build-from-source.md | 3 ++- docs/content/walkthrough.md | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9e065501..130721ee 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/cmd/proxy/Dockerfile b/cmd/proxy/Dockerfile index 4216e3e6..90fbb7da 100644 --- a/cmd/proxy/Dockerfile +++ b/cmd/proxy/Dockerfile @@ -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 diff --git a/docs/content/install/build-from-source.md b/docs/content/install/build-from-source.md index 2a9b76de..2fc34449 100644 --- a/docs/content/install/build-from-source.md +++ b/docs/content/install/build-from-source.md @@ -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: diff --git a/docs/content/walkthrough.md b/docs/content/walkthrough.md index 923228d5..b51dc100 100644 --- a/docs/content/walkthrough.md +++ b/docs/content/walkthrough.md @@ -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 ```