Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update Docs Reflecting Bazel Deprecation #334

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bazelrc

This file was deleted.

1 change: 0 additions & 1 deletion .bazelversion

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
bazel-*
*.#*
*.swp

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

This file was deleted.

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test-ci: download
make test

.PHONY: test-e2e-cip
test-e2e-cip:
test-e2e-cip: test-cip-image-build
${REPO_ROOT}/go_with_version.sh run ${REPO_ROOT}/test-e2e/cip/e2e.go \
-tests=${REPO_ROOT}/test-e2e/cip/tests.yaml \
-repo-root=${REPO_ROOT} \
Expand All @@ -88,6 +88,10 @@ test-e2e-cip-auditor:
-repo-root=${REPO_ROOT} \
-key-file=${CIP_E2E_KEY_FILE}

.PHONY: test-cip-image-build
test-cip-image-build:
./hack/test-cip-image.sh

##@ Dependencies

.PHONY: download update
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

133 changes: 0 additions & 133 deletions WORKSPACE

This file was deleted.

20 changes: 0 additions & 20 deletions cmd/cip/BUILD.bazel

This file was deleted.

20 changes: 0 additions & 20 deletions cmd/cip/cmd/BUILD.bazel

This file was deleted.

79 changes: 79 additions & 0 deletions hack/test-cip-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash

# Copyright 2020 The Kubernetes Authors.
#
# 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.

# About: This script tests the build process of the cip-image.sh script for both
# variants (cip and auditor).

set -o errexit
set -o nounset
set -o pipefail

repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)

# Ensures the provided images are built locally.
validateImages() {
local images="${*}"
local img_id
# Look for every image locally.
for img in $images; do
# Obtain the image ID.
img_id=$(docker image ls "$img" --format '{{.ID}}')
# Ensure the image exists.
if [[ -z "$img_id" ]]; then
>&2 echo "ERROR: Image \"$img\" was not found locally."
exit 1
fi
done
}

# Validate the container build process for the given variant.
testVariant() {
# Build based on the variant.
if [[ "$1" == "auditor" ]]; then
make image-build-cip-auditor-e2e
else
make image-build
fi

# Check required images are built locally.
shift
validateImages "${*}"
}

# Program entrypoint.
main() {
# Inject workspace variables.
source <("${repo_root}"/workspace_status.sh inject)

# Assemble image tag prefixes.
local stable_tag_prefix=${STABLE_IMG_REGISTRY}/${STABLE_IMG_REPOSITORY}/${STABLE_IMG_NAME}
local test_tag_prefix=${STABLE_TEST_AUDIT_STAGING_IMG_REPOSITORY}/${STABLE_IMG_NAME}

# Test each variant.
testVariant "cip" \
"${stable_tag_prefix}-auditor:latest" \
"${stable_tag_prefix}-auditor:${STABLE_IMG_TAG}" \
"${stable_tag_prefix}:latest" \
"${stable_tag_prefix}:${STABLE_IMG_TAG}"

testVariant "auditor" \
"${test_tag_prefix}-auditor-test:latest" \
"${test_tag_prefix}-auditor-test:${STABLE_IMG_TAG}"

>&2 echo "$0" finished.
}

main
Loading