Skip to content

Commit

Permalink
Not running govet or gofmt in Dockerfile builds (#1283)
Browse files Browse the repository at this point in the history
* Not running govet or gofmt in Dockerfile builds

Signed-off-by: Aaron Schlesinger <[email protected]>

* not running go-vet in precommit

Signed-off-by: Aaron Schlesinger <[email protected]>
  • Loading branch information
arschles authored Dec 7, 2020
1 parent af2b36f commit 0626a20
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ COPY pkg/ pkg/
COPY .git/ .git/

# Build
RUN VERSION=${BUILD_VERSION} make manager
RUN VERSION=${BUILD_VERSION} make manager-dockerfile

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.adapter
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ COPY .git/ .git/
RUN mkdir -p /apiserver.local.config/certificates && chmod -R 777 /apiserver.local.config

# Build
RUN VERSION=${BUILD_VERSION} make adapter
RUN VERSION=${BUILD_VERSION} make adapter-dockerfile

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,28 @@ docker-build:

# Build KEDA Operator binary
.PHONY: manager
manager: generate gofmt govet
manager: manager-dockerfile gofmt govet

# Build the manager inside the Dockerfile. This elides
# the gofmt and govet commands. Since code quality checks
# are already in CI, we don't need to run them every
# time we build the image
.PHONY: manager-dockerfile
manager-dockerfile: generate
${GO_BUILD_VARS} go build \
-ldflags "-X=github.com/kedacore/keda/version.GitCommit=$(GIT_COMMIT) -X=github.com/kedacore/keda/version.Version=$(VERSION)" \
-o bin/keda main.go

# Build KEDA Metrics Server Adapter binary
.PHONY: adapter
adapter: generate gofmt govet
adapter: adapter-dockerfile gofmt govet

# Build the adapter inside the Dockerfile. This elides
# the gofmt and govet commands. Since code quality checks
# are already in CI, we don't need to run them every
# time we build the image
.PHONY: adapter-dockerfile
adapter-dockerfile: generate
${GO_BUILD_VARS} go build \
-ldflags "-X=github.com/kedacore/keda/version.GitCommit=$(GIT_COMMIT) -X=github.com/kedacore/keda/version.Version=$(VERSION)" \
-o bin/keda-adapter adapter/main.go
Expand Down

0 comments on commit 0626a20

Please sign in to comment.