github.com/zoumo/helm@v2.5.0+incompatible/scripts/ci.sh (about) 1 #!/usr/bin/env bash 2 3 # Copyright 2016 The Kubernetes Authors All rights reserved. 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 17 # Bash 'Strict Mode' 18 # http://redsymbol.net/articles/unofficial-bash-strict-mode 19 set -euo pipefail 20 IFS=$'\n\t' 21 22 HELM_ROOT="${BASH_SOURCE[0]%/*}/.." 23 cd "$HELM_ROOT" 24 25 run_unit_test() { 26 if [[ "${CIRCLE_BRANCH-}" == "master" ]]; then 27 echo "Running unit tests with coverage'" 28 ./scripts/coverage.sh --coveralls 29 else 30 echo "Running 'unit tests'" 31 make test-unit 32 fi 33 } 34 35 run_style_check() { 36 echo "Running 'make test-style'" 37 make test-style 38 } 39 40 run_docs_check() { 41 echo "Running 'make verify-docs'" 42 make verify-docs 43 } 44 45 # Build to ensure packages are compiled 46 echo "Running 'make build'" 47 make build 48 49 case "${CIRCLE_NODE_INDEX-0}" in 50 0) run_unit_test ;; 51 1) run_style_check ;; 52 2) run_docs_check ;; 53 esac