From c8c2a214933eb7882cec2163f08aac79a34d5451 Mon Sep 17 00:00:00 2001 From: Roman Mohr Date: Thu, 7 Mar 2019 09:58:39 +0100 Subject: [PATCH] Respect hack/config* files when pushing with bazel When invoking `make bazel-push-images`, respect config settings in the hack folder. --- .gitignore | 4 ++-- Makefile | 7 +------ hack/bazel-push-images.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 8 deletions(-) create mode 100755 hack/bazel-push-images.sh diff --git a/.gitignore b/.gitignore index 8ea4b9930110..4ffcdf8d47de 100644 --- a/.gitignore +++ b/.gitignore @@ -32,5 +32,5 @@ tools/vms-generator/vms-generator .coverprofile coverage.html manifests/**/*.tmp -bazel-* -.bazelrc +/bazel-* +/.bazelrc diff --git a/Makefile b/Makefile index e15e374e4880..3ae61acacee2 100644 --- a/Makefile +++ b/Makefile @@ -13,12 +13,7 @@ bazel-build: //cmd/..." bazel-push-images: - hack/dockerized "bazel run \ - --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 \ - --workspace_status_command=./hack/print-workspace-status.sh \ - --define container_prefix=${DOCKER_PREFIX} \ - --define container_tag=${DOCKER_TAG} \ - //:push-images" + hack/dockerized "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} ./hack/bazel-push-images.sh" bazel-tests: hack/dockerized "bazel test --test_output=errors -- //pkg/... " diff --git a/hack/bazel-push-images.sh b/hack/bazel-push-images.sh new file mode 100755 index 000000000000..138d29b44b16 --- /dev/null +++ b/hack/bazel-push-images.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +# This file is part of the KubeVirt project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Copyright 2017 Red Hat, Inc. +# + +set -e + +source hack/common.sh +source hack/config.sh + +bazel run \ + --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 \ + --workspace_status_command=./hack/print-workspace-status.sh \ + --define container_prefix=${docker_prefix} \ + --define container_tag=${docker_tag} \ + //:push-images