talos/hack/test/e2e-capi.sh
Florian Klink a50c42980f
fix: use #!/usr/bin/env bash as shebang instead of #!/bin/bash
This will fix running these scripts on distros without /bin/bash, but
where bash is in $PATH, such as NixOS.

Currently, `make fmt` otherwise fails to run:

```
make[3]: Leaving directory '/home/flokli/dev/numtide/manifoldfinance/talos'
sh: ./hack/fix-artifacts.sh: /bin/bash: bad interpreter: No such file or directory
make[2]: *** [Makefile:163: local-fmt-protobuf] Error 126
make[2]: Leaving directory '/home/flokli/dev/numtide/manifoldfinance/talos'
make[1]: *** [Makefile:274: fmt-protobuf] Error 2
make[1]: Leaving directory '/home/flokli/dev/numtide/manifoldfinance/talos'
make: *** [Makefile:277: fmt] Error 2
```

Signed-off-by: Florian Klink <flokli@flokli.de>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-01-25 23:11:39 +03:00

41 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eou pipefail
source ./hack/test/e2e.sh
export CAPI_VERSION="${CAPI_VERSION:-1.0.2}"
export CABPT_VERSION="${CABPT_VERSION:-0.5.0}"
export CACPPT_VERSION="${CACPPT_VERSION:-0.4.2}"
export CAPA_VERSION="${CAPA_VERSION:-1.2.0}"
export CAPG_VERSION="${CAPG_VERSION:-1.0.0}"
# We need to override this here since e2e.sh will set it to ${TMP}/capi/kubeconfig.
export KUBECONFIG="/tmp/e2e/docker/kubeconfig"
# CABPT
export CABPT_NS="cabpt-system"
# Install envsubst
apk add --no-cache gettext
# Env vars for cloud accounts
set +x
export GCP_B64ENCODED_CREDENTIALS=${GCE_SVC_ACCT}
export AWS_B64ENCODED_CREDENTIALS=${AWS_SVC_ACCT}
set -x
${CLUSTERCTL} init \
--core "cluster-api:v${CAPI_VERSION}" \
--control-plane "talos:v${CACPPT_VERSION}" \
--infrastructure "aws:v${CAPA_VERSION},gcp:v${CAPG_VERSION}" \
--bootstrap "talos:v${CABPT_VERSION}"
# Wait for the talosconfig
timeout=$(($(date +%s) + ${TIMEOUT}))
until ${KUBECTL} wait --timeout=1s --for=condition=Ready -n ${CABPT_NS} pods --all; do
[[ $(date +%s) -gt $timeout ]] && exit 1
echo 'Waiting to CABPT pod to be available...'
sleep 5
done