Skip to content

Commit 69a5569

Browse files
solidnerdnolte
andauthored
chore(ci): add dynamic variables for e2e scripts (#6)
Co-authored-by: nolte <[email protected]>
1 parent dfefd8c commit 69a5569

File tree

2 files changed

+16
-27
lines changed

2 files changed

+16
-27
lines changed

scripts/tst-00-prepare-kind.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
#!/usr/bin/env bash
2-
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io
3-
42
set -o errexit
53
set -o pipefail
64
set -o nounset
7-
# set -o xtrace
85

9-
# Set magic variables for current file & dir
10-
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11-
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
12-
__base="$(basename ${__file} .sh)"
13-
__root="$(cd "$(dirname "${__dir}")" && pwd)" # <-- change this as it depends on your app
146

15-
arg1="${1:-}"
7+
INGRESS_NGINX_CHART_VERSION=${INGRESS_NGINX_CHART_VERSION:-2.1.0}
168

179
echo "Start Local Kind k8s Cluster for testing"
1810

@@ -37,9 +29,9 @@ nodes:
3729
EOF
3830

3931
echo "Install Ingress for Harbor ApiAccess"
40-
41-
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-2.1.0/deploy/static/provider/kind/deploy.yaml --wait=true
42-
32+
set +x
33+
kubectl apply -f "https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-${INGRESS_NGINX_CHART_VERSION}/deploy/static/provider/kind/deploy.yaml" --wait=true
34+
set -x
4335
sleep 30
4436

4537
echo "Waiting Ingress is successfull started"

scripts/tst-01-prepare-harbor.sh

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
#!/usr/bin/env bash
2-
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io
2+
#
3+
# This can be also run with ``
4+
# ./tst-01-prepare-harbor.sh "10-42-0-100.sslip.io" "1.2.0"
35

4-
set -o errexit
6+
set -e
57
set -o pipefail
68
set -o nounset
7-
# set -o xtrace
89

9-
# Set magic variables for current file & dir
10-
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11-
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
12-
__base="$(basename ${__file} .sh)"
13-
__root="$(cd "$(dirname "${__dir}")" && pwd)" # <-- change this as it depends on your app
10+
INGRESS_DOMAIN=${1:-"192-168-178-51.sslip.io"}
11+
HARBOR_CHART_VERSION=${2:-"1.3.2"}
1412

15-
arg1="${1:-}"
13+
kubectl create ns harbor || true
1614

17-
kubectl create ns harbor
18-
19-
helm repo add harbor https://helm.goharbor.io
20-
21-
export INGRESSDOMAIN=192-168-178-51.sslip.io
15+
helm repo add harbor https://helm.goharbor.io
2216

2317
helm upgrade -i tf-harbor-test harbor/harbor \
18+
--version "$HARBOR_CHART_VERSION" \
2419
-n harbor \
25-
--set expose.ingress.hosts.core=harbor.${INGRESSDOMAIN},expose.ingress.hosts.notary=notary.${INGRESSDOMAIN},externalURL=https://harbor.${INGRESSDOMAIN}
20+
--set expose.ingress.hosts.core="harbor.${INGRESS_DOMAIN}" \
21+
--set expose.ingress.hosts.notary="notary.${INGRESS_DOMAIN}" \
22+
--set externalURL="https://harbor.${INGRESS_DOMAIN}"
2623

2724

2825
kubectl wait --namespace harbor \

0 commit comments

Comments
 (0)