diff --git a/Makefile b/Makefile index dda74327..1c32404d 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,10 @@ VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods \ EXTERNAL_TOOLS=\ golang.org/x/tools/cmd/cover \ golang.org/x/lint/golint \ - github.com/axw/gocov/gocov \ + github.com/axw/gocov/gocov@v1.1 \ github.com/matm/gocov-html/cmd/gocov-html \ github.com/onsi/ginkgo/ginkgo \ - github.com/onsi/gomega/... + github.com/onsi/gomega/...@v1.35 # The images can be pushed to any docker/image registeries # like docker hub, quay. The registries are specified in @@ -86,6 +86,7 @@ clean: @echo "--> Cleaning Directory" ; go clean -testcache rm -rf bin + chmod -R u+w ${GOPATH} rm -rf ${GOPATH}/bin/${CSI_DRIVER} rm -rf ${GOPATH}/pkg/* @@ -119,7 +120,10 @@ verify-deps: deps bootstrap: controller-gen install-golangci-lint @for tool in $(EXTERNAL_TOOLS) ; do \ echo "+ Installing $$tool" ; \ - cd && GO111MODULE=on go install $$tool@latest; \ + if ! echo $$tool | grep "@"; then \ + tool=$$tool@latest ; \ + fi ; \ + GO111MODULE=on go install $$tool; \ done ## golangci-lint tool used to check linting tools in codebase @@ -130,7 +134,7 @@ bootstrap: controller-gen install-golangci-lint ## Install golangci-lint only if tool doesn't exist in system .PHONY: install-golangci-lint install-golangci-lint: - $(if $(shell which golangci-lint), echo "golangci-lint already exist in system", (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b "${GOPATH}/bin" v1.56.2)) + $(if $(shell which golangci-lint), echo "golangci-lint already exist in system", (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.56.2)) .PHONY: controller-gen controller-gen: @@ -222,7 +226,7 @@ lvm-driver-image: lvm-driver @echo "+ Generating ${CSI_DRIVER} image" @echo "--------------------------------" @cp bin/${CSI_DRIVER}/${CSI_DRIVER} buildscripts/${CSI_DRIVER}/ - cd buildscripts/${CSI_DRIVER} && sudo docker build -t ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} ${DBUILD_ARGS} . && sudo docker tag ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} quay.io/${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} + cd buildscripts/${CSI_DRIVER} && docker build -t ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} ${DBUILD_ARGS} . && docker tag ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} quay.io/${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} @rm buildscripts/${CSI_DRIVER}/${CSI_DRIVER} .PHONY: ansible-runner-image @@ -230,7 +234,7 @@ ansible-runner-image: @echo "------------------" @echo "--> Build ansible-runner image for lvm-localpv e2e-tests" @echo "------------------" - sudo docker build . -f e2e-tests/Dockerfile -t ${IMAGE_ORG}/lvm-localpv-e2e:ci + docker build . -f e2e-tests/Dockerfile -t ${IMAGE_ORG}/lvm-localpv-e2e:ci .PHONY: ci ci: diff --git a/shell.nix b/shell.nix index d070f65a..f7818186 100644 --- a/shell.nix +++ b/shell.nix @@ -16,14 +16,16 @@ pkgs.mkShell { minikube semver-tool yq-go - ]; + which + curl + cacert + util-linux + ] ++ pkgs.lib.optional (builtins.getEnv "IN_NIX_SHELL" == "pure") docker; shellHook = '' - export HOME=${builtins.getEnv "HOME"} export GOPATH=$(pwd)/nix/.go export GOCACHE=$(pwd)/nix/.go/cache export TMPDIR=$(pwd)/nix/.tmp export PATH=$GOPATH/bin:$PATH mkdir -p "$TMPDIR" - make bootstrap ''; }