From 2ea184b3df2254ff5e05723e64d792b3f7a6544f Mon Sep 17 00:00:00 2001 From: Arik Hadas Date: Mon, 17 Jul 2023 19:08:09 +0300 Subject: [PATCH] Push ovirt-populator image with bazel Signed-off-by: Arik Hadas --- .github/workflows/build-push-images.yml | 1 - BUILD.bazel | 9 +++++++++ WORKSPACE | 5 +++++ cmd/ovirt-populator/BUILD.bazel | 11 +++++++++++ hack/release-images.sh | 1 + ovirt_populator_containerfile | 1 + 6 files changed, 27 insertions(+), 1 deletion(-) create mode 120000 ovirt_populator_containerfile diff --git a/.github/workflows/build-push-images.yml b/.github/workflows/build-push-images.yml index e93304e8f..f52be06f0 100644 --- a/.github/workflows/build-push-images.yml +++ b/.github/workflows/build-push-images.yml @@ -38,5 +38,4 @@ jobs: run: | cd ${GITHUB_WORKSPACE} ./hack/release-images.sh - make push-ovirt-populator-image make push-openstack-populator-image diff --git a/BUILD.bazel b/BUILD.bazel index fcbf8b0df..cbd1ddac0 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -58,6 +58,15 @@ container_push( tag = "$${REGISTRY_TAG:-devel}", ) +container_push( + name = "push-ovirt-populator", + format = "Docker", + image = "//cmd/ovirt-populator:ovirt-populator-image", + registry = "$${REGISTRY:-quay.io}", + repository = "$${REGISTRY_ACCOUNT:-}$${REGISTRY_ACCOUNT:+/}ovirt-populator", + tag = "$${REGISTRY_TAG:-devel}", +) + container_push( name = "push-forklift-controller", format = "Docker", diff --git a/WORKSPACE b/WORKSPACE index d3b22fdeb..a7cde4c8c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -43,6 +43,11 @@ dockerfile_image( dockerfile = "//:ova_provider_server_containerfile", ) +dockerfile_image( + name = "ovirt-populator-image-dockerfile", + dockerfile = "//:ovirt_populator_containerfile", +) + load( "@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", docker_toolchain_configure = "toolchain_configure", diff --git a/cmd/ovirt-populator/BUILD.bazel b/cmd/ovirt-populator/BUILD.bazel index 045194690..7d7a96a37 100644 --- a/cmd/ovirt-populator/BUILD.bazel +++ b/cmd/ovirt-populator/BUILD.bazel @@ -27,3 +27,14 @@ go_library( "//vendor/k8s.io/klog/v2:klog", ], ) + +load( + "@io_bazel_rules_docker//container:container.bzl", + "container_image", +) + +container_image( + name = "ovirt-populator-image", + base = "@ovirt-populator-image-dockerfile//image:dockerfile_image.tar", + visibility = ["//visibility:public"], +) diff --git a/hack/release-images.sh b/hack/release-images.sh index ad10835df..a5aaf215b 100755 --- a/hack/release-images.sh +++ b/hack/release-images.sh @@ -21,6 +21,7 @@ POPULATOR_CONTROLLER_IMAGE=${REGISTRY}/${REGISTRY_ORG}/populator-controller:${RE OVA_PROVIDER_SERVER=${REGISTRY}/${REGISTRY_ORG}/forklift-ova-provider-server:${REGISTRY_TAG} bazel run push-forklift-api +bazel run push-ovirt-populator bazel run --package_path=virt-v2v/cold push-forklift-virt-v2v bazel run --package_path=virt-v2v/warm push-forklift-virt-v2v-warm bazel run push-populator-controller diff --git a/ovirt_populator_containerfile b/ovirt_populator_containerfile new file mode 120000 index 000000000..ed2c43407 --- /dev/null +++ b/ovirt_populator_containerfile @@ -0,0 +1 @@ +hack/ovirt-populator/Containerfile \ No newline at end of file