Skip to content

Commit

Permalink
Replace bazel with Makefile and bash (#401)
Browse files Browse the repository at this point in the history
* Replace bazel with Makefile and bash

The gocli project is not complex enough to require bazel

Signed-off-by: Quique Llorente <[email protected]>

* Update gocli hash

Signed-off-by: Quique Llorente <[email protected]>

* Use system's go cmd instead of vendoring it

Signed-off-by: Quique Llorente <[email protected]>

* Update gocli sha

Signed-off-by: Quique Llorente <[email protected]>
  • Loading branch information
qinqon authored Jul 7, 2020
1 parent 3ad11b7 commit 29a73d5
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 220 deletions.
1 change: 1 addition & 0 deletions cluster-provision/gocli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/go*
75 changes: 0 additions & 75 deletions cluster-provision/gocli/BUILD

This file was deleted.

45 changes: 27 additions & 18 deletions cluster-provision/gocli/Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
all: fmt build
SHELL := /bin/bash

.PHONY: build
build: fmt
bazel run //:gazelle
bazel build //:cli
BIN_DIR = $(CURDIR)/build
GO ?= go

export GO111MODULE=on
export GOPROXY=direct
export GOSUMDB=off
export GOFLAGS=-mod=vendor


all: container-run

.PHONY: gocli
cli: fmt
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -o $(BIN_DIR)/cli ./cmd/cli

.PHONY: fmt
fmt:
go fmt ./cmd/...
go fmt ./docker/...
$(GO) fmt ./cmd/...
$(GO) fmt ./docker/...

.PHONY: container
container: fmt
bazel build //:gocli
container: cli
docker build -t kubevirtci/gocli build/

.PHONY: container-run
container-run: fmt
bazel run //:gocli
container-run: container
docker run kubevirtci/gocli

.PHONY: deps-update
deps-update:
GO111MODULE=on go mod tidy
GO111MODULE=on go mod vendor
bazel run //:gazelle
.PHONY: vendor
vendor:
$(GO) mod tidy
$(GO) mod vendor

.PHONY: push
push: fmt
bazel run --host_force_python=PY2 //:push-all
push: container
docker push kubevirtci/gocli
52 changes: 0 additions & 52 deletions cluster-provision/gocli/WORKSPACE

This file was deleted.

1 change: 1 addition & 0 deletions cluster-provision/gocli/build/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go*
5 changes: 5 additions & 0 deletions cluster-provision/gocli/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM scratch

COPY cli /cli

ENTRYPOINT ["/cli"]
32 changes: 0 additions & 32 deletions cluster-provision/gocli/cmd/BUILD.bazel

This file was deleted.

File renamed without changes.
24 changes: 0 additions & 24 deletions cluster-provision/gocli/cmd/okd/BUILD.bazel

This file was deleted.

17 changes: 0 additions & 17 deletions cluster-provision/gocli/cmd/utils/BUILD.bazel

This file was deleted.

4 changes: 3 additions & 1 deletion cluster-provision/gocli/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module kubevirt.io/kubevirtci/cluster-provision/gocli

go 1.13

require (
github.com/Microsoft/go-winio v0.4.7 // indirect
github.com/Sirupsen/logrus v1.4.1 // indirect
Expand All @@ -11,7 +13,7 @@ require (
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/opencontainers/runc v0.1.1 // indirect
github.com/pkg/errors v0.8.0
github.com/pkg/errors v0.8.0 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/spf13/cobra v0.0.2
github.com/spf13/pflag v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion cluster-up/cluster/images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

declare -A IMAGES
IMAGES[gocli]="gocli@sha256:220f55f6b1bcb3975d535948d335bd0e6b6297149a3eba1a4c14cad9ac80f80d"
IMAGES[gocli]="gocli@sha256:2ce75db868bbf2811395dfe4f73a68160d2ad700b1e08aeee6956b4943ceb237"
if [ -z $KUBEVIRTCI_PROVISION_CHECK ]; then
IMAGES[k8s-fedora-1.17.0]="k8s-fedora-1.17.0@sha256:aebf67b8b1b499c721f4d98a7ab9542c680553a14cbc144d1fa701fe611f3c0d"
IMAGES[k8s-1.18]="k8s-1.18@sha256:91ea0c4e10a356fe315049e4e56801ce62b73b5b5d901e6e0eccbcc171070674"
Expand Down

0 comments on commit 29a73d5

Please sign in to comment.