Skip to content

Commit

Permalink
Remove bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
mnecas committed Jan 13, 2025
1 parent 3113e86 commit e03e2f4
Show file tree
Hide file tree
Showing 257 changed files with 57,457 additions and 11,881 deletions.
36 changes: 0 additions & 36 deletions .bazelrc

This file was deleted.

2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
**/bin
**/dist
**/node_modules
WORKSPACE
**/BUILD.bazel

# Ignore docs
docs/
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ migsamples
# tilt settings
tools/tilt/tilt-settings.json

# bazel build artifacts
bazel-*
.bazeldnf

# deploy env
hack/deploy/**/deploy.env

Expand Down
140 changes: 0 additions & 140 deletions BUILD.bazel

This file was deleted.

99 changes: 15 additions & 84 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,7 @@ OVA_PROVIDER_SERVER_IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/forklift-ova-provider-s
MUST_GATHER_IMAGE ?= quay.io/kubev2v/forklift-must-gather:latest
UI_PLUGIN_IMAGE ?= quay.io/kubev2v/forklift-console-plugin:latest

BAZEL_OPTS ?= --verbose_failures

ifneq (,$(findstring /usr/lib64/ccache,$(PATH)))
CCACHE_DIR ?= $${HOME}/.ccache
BAZEL_OPTS += --sandbox_writable_path=$(CCACHE_DIR)
$(shell [ -d $(CCACHE_DIR) ] || mkdir -p $(CCACHE_DIR))
endif

XDG_RUNTIME_DIR ?=
ifneq (,$(XDG_RUNTIME_DIR))
BAZEL_OPTS += --sandbox_writable_path=$${XDG_RUNTIME_DIR}
$(shell [ -d $(XDG_RUNTIME_DIR) ] || mkdir -p $(XDG_RUNTIME_DIR))
endif

ci: all tidy vendor bazel-generate generate-verify
ci: all tidy vendor generate-verify

all: test forklift-controller

Expand Down Expand Up @@ -180,80 +166,42 @@ generate-verify: generate
./hack/verify-generate.sh

build-controller-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run cmd/forklift-controller:forklift-controller-image \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD)
$(CONTAINER_CMD) build -t $(CONTROLLER_IMAGE) -f build/forklift-controller/Containerfile .

push-controller-image: build-controller-image
$(CONTAINER_CMD) tag bazel/cmd/forklift-controller:forklift-controller-image $(CONTROLLER_IMAGE)
$(CONTAINER_CMD) push $(CONTROLLER_IMAGE)

build-api-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run cmd/forklift-api:forklift-api-image \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD)
$(CONTAINER_CMD) build -t $(API_IMAGE) -f build/forklift-api/Containerfile .

push-api-image: build-api-image
$(CONTAINER_CMD) tag bazel/cmd/forklift-api:forklift-api-image $(API_IMAGE)
$(CONTAINER_CMD) push $(API_IMAGE)

build-validation-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run validation:forklift-validation-image \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD)
$(CONTAINER_CMD) build -t $(VALIDATION_IMAGE) -f build/validation/Containerfile .

push-validation-image: build-validation-image
$(CONTAINER_CMD) tag bazel/validation:forklift-validation-image $(VALIDATION_IMAGE)
$(CONTAINER_CMD) push $(VALIDATION_IMAGE)

build-operator-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run operator:forklift-operator-image \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD)
$(CONTAINER_CMD) build -t $(OPERATOR_IMAGE) -f build/forklift-operator/Containerfile .

push-operator-image: build-operator-image
$(CONTAINER_CMD) tag bazel/operator:forklift-operator-image $(OPERATOR_IMAGE)
$(CONTAINER_CMD) push $(OPERATOR_IMAGE)

build-virt-v2v-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run --package_path=virt-v2v forklift-virt-v2v \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD)
$(CONTAINER_CMD) build -t $(VIRT_V2V_IMAGE) -f build/virt-v2v/Containerfile-upstream .

push-virt-v2v-image: build-virt-v2v-image
$(CONTAINER_CMD) tag bazel:forklift-virt-v2v $(VIRT_V2V_IMAGE)
$(CONTAINER_CMD) push $(VIRT_V2V_IMAGE)

build-operator-bundle-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run operator:forklift-operator-bundle-image \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD) \
--action_env VERSION=$(VERSION) \
--action_env NAMESPACE=$(NAMESPACE) \
--action_env CHANNELS=$(CHANNELS) \
--action_env DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) \
--action_env OPERATOR_IMAGE=$(OPERATOR_IMAGE) \
--action_env MUST_GATHER_IMAGE=$(MUST_GATHER_IMAGE) \
--action_env UI_PLUGIN_IMAGE=$(UI_PLUGIN_IMAGE) \
--action_env VALIDATION_IMAGE=$(VALIDATION_IMAGE) \
--action_env VIRT_V2V_IMAGE=$(VIRT_V2V_IMAGE) \
--action_env CONTROLLER_IMAGE=$(CONTROLLER_IMAGE) \
--action_env API_IMAGE=$(API_IMAGE) \
--action_env POPULATOR_CONTROLLER_IMAGE=$(POPULATOR_CONTROLLER_IMAGE) \
--action_env OVIRT_POPULATOR_IMAGE=$(OVIRT_POPULATOR_IMAGE) \
--action_env OPENSTACK_POPULATOR_IMAGE=$(OPENSTACK_POPULATOR_IMAGE)\
--action_env OVA_PROVIDER_SERVER_IMAGE=$(OVA_PROVIDER_SERVER_IMAGE)
$(CONTAINER_CMD) build -t $(OPERATOR_BUNDLE_IMAGE) -f build/forklift-operator-bundle/Containerfile --build-arg-file build/forklift-operator-bundle/upstream-args .

push-operator-bundle-image: build-operator-bundle-image
$(CONTAINER_CMD) tag bazel/operator:forklift-operator-bundle-image $(OPERATOR_BUNDLE_IMAGE)
$(CONTAINER_CMD) push $(OPERATOR_BUNDLE_IMAGE)

# start mnecas TODO
build-operator-index-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run operator:forklift-operator-index-image \
Expand All @@ -270,45 +218,30 @@ build-operator-index-image: check_container_runtime
push-operator-index-image: build-operator-index-image
$(CONTAINER_CMD) tag bazel/operator:forklift-operator-index-image $(OPERATOR_INDEX_IMAGE)
$(CONTAINER_CMD) push $(OPERATOR_INDEX_IMAGE)
# end mnecas TODO

build-populator-controller-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run cmd/populator-controller:populator-controller-image \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD)
$(CONTAINER_CMD) build -t $(POPULATOR_CONTROLLER_IMAGE) -f build/populator-controller/Containerfile .

push-populator-controller-image: build-populator-controller-image
$(CONTAINER_CMD) tag bazel/cmd/populator-controller:populator-controller-image $(POPULATOR_CONTROLLER_IMAGE)
$(CONTAINER_CMD) push $(POPULATOR_CONTROLLER_IMAGE)

build-ovirt-populator-image:
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run cmd/ovirt-populator:ovirt-populator-image \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD)
$(CONTAINER_CMD) build -t $(OVIRT_POPULATOR_IMAGE) -f build/ovirt-populator/Containerfile-upstream .

push-ovirt-populator-image: build-ovirt-populator-image
$(CONTAINER_CMD) tag bazel/cmd/ovirt-populator:ovirt-populator-image $(OVIRT_POPULATOR_IMAGE)
$(CONTAINER_CMD) push $(OVIRT_POPULATOR_IMAGE)

build-openstack-populator-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run cmd/openstack-populator:openstack-populator-image \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD)
$(CONTAINER_CMD) build -t $(OPENSTACK_POPULATOR_IMAGE) -f build/openstack-populator/Containerfile .

push-openstack-populator-image: build-openstack-populator-image
$(CONTAINER_CMD) tag bazel/cmd/openstack-populator:openstack-populator-image $(OPENSTACK_POPULATOR_IMAGE)
$(CONTAINER_CMD) push $(OPENSTACK_POPULATOR_IMAGE)

build-ova-provider-server-image: check_container_runtime
export CONTAINER_CMD=$(CONTAINER_CMD); \
bazel run cmd/ova-provider-server:ova-provider-server-image \
$(BAZEL_OPTS) \
--action_env CONTAINER_CMD=$(CONTAINER_CMD)
$(CONTAINER_CMD) build -t $(OVA_PROVIDER_SERVER_IMAGE) -f build/ova-provider-server/Containerfile .

push-ova-provider-server-image: build-ova-provider-server-image
$(CONTAINER_CMD) tag bazel/cmd/ova-provider-server:ova-provider-server-image $(OVA_PROVIDER_SERVER_IMAGE)
$(CONTAINER_CMD) push $(OVA_PROVIDER_SERVER_IMAGE)

build-all-images: build-api-image \
Expand All @@ -317,12 +250,13 @@ build-all-images: build-api-image \
build-operator-image \
build-virt-v2v-image \
build-operator-bundle-image \
build-operator-index-image \
build-populator-controller-image \
build-ovirt-populator-image \
build-openstack-populator-image\
build-ova-provider-server-image

# build-operator-index-image \
push-all-images: push-api-image \
push-controller-image \
push-validation-image \
Expand All @@ -343,9 +277,6 @@ check_container_runtime:
exit 1; \
fi

bazel-generate:
bazel run //:gazelle cmd operator pkg tests validation

.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN)
$(DEFAULT_CONTROLLER_GEN):
Expand Down
Loading

0 comments on commit e03e2f4

Please sign in to comment.