Skip to content

Commit

Permalink
Respect hack/config* files when pushing with bazel
Browse files Browse the repository at this point in the history
When invoking `make bazel-push-images`, respect config settings in the
hack folder.
  • Loading branch information
rmohr committed Mar 7, 2019
1 parent 0c815ee commit c8c2a21
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ tools/vms-generator/vms-generator
.coverprofile
coverage.html
manifests/**/*.tmp
bazel-*
.bazelrc
/bazel-*
/.bazelrc
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/... "
Expand Down
30 changes: 30 additions & 0 deletions hack/bazel-push-images.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c8c2a21

Please sign in to comment.