From ee1f458bb15e9496430632268534687167d3057f Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Thu, 17 Oct 2019 22:08:21 +0530 Subject: [PATCH] Fix CI config (#12771) * Fix CI config - -mod=vendor flag was not being passed during the build stage, forcing it to download everything again. - Optimize the git clone of webapp with --depth=1 and use GIT_SSH_COMMAND to clone. - Add $(GOFLAGS) to some other places which got missed out. * Remove GOFLAGS from go list command It does not work for Go 1.12. Need to fix later. --- .circleci/config.yml | 4 +--- Makefile | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 57a72507b2..e32e9e70a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,9 +20,7 @@ jobs: - checkout - run: | cd ../ - mkdir -p ~/.ssh/ - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - git clone git@github.com:mattermost/mattermost-webapp.git + GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" git clone --depth=1 git@github.com:mattermost/mattermost-webapp.git cd mattermost-webapp git checkout $CIRCLE_BRANCH || git checkout master export WEBAPP_GIT_COMMIT=$(git rev-parse HEAD) diff --git a/Makefile b/Makefile index f47b6de541..f799b8e966 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ TESTFLAGS ?= -short TESTFLAGSEE ?= -short # Packages lists -TE_PACKAGES=$(shell go list ./...) +TE_PACKAGES=$(shell $(GO) list ./...) # Plugins Packages PLUGIN_PACKAGES=mattermost-plugin-zoom-v1.1.1 @@ -104,7 +104,7 @@ else IGNORE:=$(shell rm -f imports/imports.go) endif -EE_PACKAGES=$(shell go list ./enterprise/...) +EE_PACKAGES=$(shell $(GO) list ./enterprise/...) ifeq ($(BUILD_ENTERPRISE_READY),true) ALL_PACKAGES=$(TE_PACKAGES) $(EE_PACKAGES) @@ -154,7 +154,7 @@ govet: ## Runs govet against all packages. env GO111MODULE=off $(GO) get golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow $(GO) vet $(GOFLAGS) $(ALL_PACKAGES) || exit 1 $(GO) vet -vettool=$(GOPATH)/bin/shadow $(GOFLAGS) $(ALL_PACKAGES) || exit 1 - $(GO) run plugin/checker/main.go + $(GO) run $(GOFLAGS) plugin/checker/main.go gofmt: ## Runs gofmt against all packages. @echo Running GOFMT