mirror of
https://github.com/helm/chart-testing.git
synced 2026-02-05 09:45:14 +01:00
* [WIP] Factor out testing code from charts * Minor various fixes Please enter the commit message for your changes. Lines starting * Start readme * Update readme and add GKE example * Add CircleCI job for ShellCheck * Install Helm and kubectl after other tools Also: Hard-code version for kubectl. * Fix readme * Update maintainer validation 'chartlib::validate_maintainers' should not log an error if there's no maintainers section. This is already covered by the schema validation. * Add random suffix to namespaces * Improve container logs output * Improve logging * Add --cleanup flag to 'helm test' * Improve namespace cleanup * Improve logging * Add random suffixes to releases * Update logging and Docker image version * Update GKE example * Fix Bash array declarations * Remove user from Docker image * Add summary * Use kubectl rollout status for deployments * Add some more fixes * Build dependencies before linting * Fix array initialization * Increase sleep time for namespace polling * Add missing colon * Create v1.0.0 * Update Helm to v2.9.1 * Add missing local keywords * Bump image version * Update copyright headers
75 lines
1.7 KiB
Bash
Executable File
75 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
|
||
# Copyright 2018 The Helm Authors. All rights reserved.
|
||
#
|
||
# 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.
|
||
|
||
set -o errexit
|
||
set -o nounset
|
||
set -o pipefail
|
||
|
||
readonly IMAGE_TAG=v1.0.2
|
||
readonly IMAGE_REPOSITORY="gcr.io/kubernetes-charts-ci/chart-testing"
|
||
readonly SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||
|
||
show_help() {
|
||
cat << EOF
|
||
Usage: ${0##*/} <args>
|
||
-h, --help Display help
|
||
-v, --verbose Display verbose output
|
||
-p, --push Push image to registry
|
||
EOF
|
||
}
|
||
|
||
main() {
|
||
local verbose=
|
||
local push=
|
||
|
||
while :; do
|
||
case "${1:-}" in
|
||
-h|--help)
|
||
show_help
|
||
exit
|
||
;;
|
||
-v|--verbose)
|
||
verbose=true
|
||
;;
|
||
-p|--push)
|
||
push=true
|
||
;;
|
||
-?*)
|
||
printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2
|
||
;;
|
||
*)
|
||
break
|
||
;;
|
||
esac
|
||
|
||
shift
|
||
done
|
||
|
||
[[ -n "$verbose" ]] && set -o xtrace
|
||
|
||
pushd "$SCRIPT_DIR"
|
||
|
||
docker build --tag "$IMAGE_REPOSITORY:$IMAGE_TAG" .
|
||
|
||
if [[ -n "$push" ]]; then
|
||
docker push "$IMAGE_REPOSITORY:$IMAGE_TAG"
|
||
fi
|
||
|
||
popd
|
||
}
|
||
|
||
main "$@"
|