forked from kubernetes-sigs/kustomize
-
Notifications
You must be signed in to change notification settings - Fork 1
/
testExamplesAgainstKustomize.sh
executable file
·54 lines (45 loc) · 1.44 KB
/
testExamplesAgainstKustomize.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
#
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0
set -o nounset
set -o errexit
set -o pipefail
version=$1
# All hack scripts should run from top level.
. hack/shellHelpers.sh
echo "Installing kustomize ${version}"
MYGOBIN=$(go env GOBIN)
MYGOBIN="${MYGOBIN:-$(go env GOPATH)/bin}"
# Always rebuild, never assume the installed verion is
# the right one to test.
rm -f $MYGOBIN/kustomize
if [ "$version" == "HEAD" ]; then
(cd kustomize; go install .)
else
GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/${version}
fi
# TODO: change the label?
# We test against the latest release, and HEAD, and presumably
# any branch using this label, so it should probably get
# a new value.
export MYGOBIN
mdrip --mode test --blockTimeOut 15m \
--label testAgainstLatestRelease examples
# TODO: make work for non-linux
if onLinuxAndNotOnRemoteCI; then
if [ "$version" == "HEAD" ]; then
echo "On linux, and not on remote CI. Running helm tests."
make $MYGOBIN/helmV3
mdrip --mode test --label testHelm examples/chart.md
else
echo "Skipping helm tests against $version."
echo "Helm chart inflator has new features (includeCRD) only in HEAD."
fi
fi
# Force outside logic to rebuild kustomize rather than
# rely on whatever this script just did. Tests should
# be order independent.
echo "Removing kustomize ${version}"
rm $MYGOBIN/kustomize
echo "Example tests passed against ${version}."