Skip to content

Commit

Permalink
Merge pull request kubevirt#2080 from rmohr/env-vars-container
Browse files Browse the repository at this point in the history
Fix some inconsistencies introduces with the bazel switch
  • Loading branch information
Artyom Lukianov authored Mar 7, 2019
2 parents f6b61ee + c8c2a21 commit f13e23f
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 16 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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ script:

deploy:
- provider: script
script: docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" && CONTAINER_PREFIX="index.docker.io/kubevirt" CONTAINER_TAG="latest" make bazel-push-images
script: docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" && DOCKER_PREFIX="index.docker.io/kubevirt" DOCKER_TAG="latest" make bazel-push-images
skip_cleanup: true
on:
branch: master
Expand All @@ -39,7 +39,7 @@ deploy:
all_branches: true
condition: $TRAVIS_BRANCH != revert-*
- provider: script
script: docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" && CONTAINER_PREFIX="index.docker.io/kubevirt" CONTAINER_TAG="$TRAVIS_TAG" make bazel-push-images
script: docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" && DOCKER_PREFIX="index.docker.io/kubevirt" DOCKER_TAG="$TRAVIS_TAG" make bazel-push-images
skip_cleanup: true
file:
on:
Expand Down
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=${CONTAINER_PREFIX} \
--define container_tag=${CONTAINER_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
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ _go_image_repos()

http_archive(
name = "io_bazel_rules_container_rpm",
sha256 = "7ace5bc7aa10697196d3c48ef5d73b0fc52b6e27c0bad3ce10751f66c5cc383c",
strip_prefix = "rules_container_rpm-0.0.3",
urls = ["https://github.com/rmohr/rules_container_rpm/archive/v0.0.3.tar.gz"],
sha256 = "b419c25576e148e537a93fafdc10cb78faf1174558d853754727b586793e71d1",
strip_prefix = "rules_container_rpm-0.0.4",
urls = ["https://github.com/rmohr/rules_container_rpm/archive/v0.0.4.tar.gz"],
)

# Get container-disk-v1alpha RPM's
Expand Down
2 changes: 1 addition & 1 deletion cluster/ephemeral-provider-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function _add_common_params() {
function build() {
# Build everyting and publish it
${KUBEVIRT_PATH}hack/dockerized "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} KUBEVIRT_PROVIDER=${KUBEVIRT_PROVIDER} IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY} VERBOSITY=${VERBOSITY} ./hack/build-manifests.sh"
CONTAINER_PREFIX=${docker_prefix} CONTAINER_TAG=${docker_tag} make bazel-push-images
DOCKER_PREFIX=${docker_prefix} DOCKER_TAG=${docker_tag} make bazel-push-images

# Make sure that all nodes use the newest images
container=""
Expand Down
4 changes: 2 additions & 2 deletions cluster/external/provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ function down() {

function build() {
# Build code and manifests
${KUBEVIRT_PATH}hack/dockerized "DOCKER_TAG=${DOCKER_TAG} KUBEVIRT_PROVIDER=${KUBEVIRT_PROVIDER} ./hack/build-manifests.sh"
make push
${KUBEVIRT_PATH}hack/dockerized "DOCKER_TAG=${DOCKER_TAG} DOCKER_PREFIX=${docker_prefix} KUBEVIRT_PROVIDER=${KUBEVIRT_PROVIDER} ./hack/build-manifests.sh"
DOCKER_PREFIX=${docker_prefix} DOCKER_TAG=${docker_tag} make bazel-push-images
}
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 f13e23f

Please sign in to comment.