2020-08-06 06:26:31 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
pwd=$(pwd)
|
2022-02-03 07:41:58 +00:00
|
|
|
hash=$(git describe --match "[0-9].[0-9]-dev*")
|
2020-08-06 06:26:31 +00:00
|
|
|
#
|
|
|
|
## Install Kind
|
2022-05-07 15:46:50 +00:00
|
|
|
curl -Lo "$pwd"/kind https://kind.sigs.k8s.io/dl/v0.11.0/kind-linux-amd64
|
|
|
|
chmod a+x "$pwd"/kind
|
2020-08-06 06:26:31 +00:00
|
|
|
|
|
|
|
## Create Kind Cluster
|
2022-02-23 15:52:08 +00:00
|
|
|
if [ -z "${KIND_IMAGE}" ]; then
|
2022-05-07 15:46:50 +00:00
|
|
|
"$pwd"/kind create cluster
|
2022-02-23 15:52:08 +00:00
|
|
|
else
|
2022-05-07 15:46:50 +00:00
|
|
|
"$pwd"/kind create cluster --image="${KIND_IMAGE}"
|
2022-02-23 15:52:08 +00:00
|
|
|
fi
|
|
|
|
|
2022-05-07 15:46:50 +00:00
|
|
|
"$pwd"/kind load docker-image ghcr.io/kyverno/kyverno:"$hash"
|
|
|
|
"$pwd"/kind load docker-image ghcr.io/kyverno/kyvernopre:"$hash"
|
2020-08-06 06:26:31 +00:00
|
|
|
|
|
|
|
pwd=$(pwd)
|
2022-05-07 15:46:50 +00:00
|
|
|
cd "$pwd"/config
|
2020-08-06 06:26:31 +00:00
|
|
|
echo "Installing kustomize"
|
2020-12-13 06:13:01 +00:00
|
|
|
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
|
2022-05-07 15:46:50 +00:00
|
|
|
kustomize edit set image ghcr.io/kyverno/kyverno:"$hash"
|
|
|
|
kustomize edit set image ghcr.io/kyverno/kyvernopre:"$hash"
|
|
|
|
kustomize build "$pwd"/config/ -o "$pwd"/config/install.yaml
|