Skip to content

Commit e5ddcbc

Browse files
nickboldtrhdh-bot
andauthored
chore: for now, comment out the non-working chart repo install stuff until we have this implemented again in RHIDP-6668 (#151)
Signed-off-by: RHDH Build (rhdh-bot) <rhdh-bot@redhat.com> Co-authored-by: RHDH Build (rhdh-bot) <rhdh-bot@redhat.com>
1 parent c86275b commit e5ddcbc

1 file changed

Lines changed: 24 additions & 20 deletions

File tree

.rhdh/scripts/install.sh

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,67 @@
1+
#!/bin/bash
12
# install a helm chart with the correct global.clusterRouterBase
23

34
# default namespace if none set
45
namespace="rhdh-helm"
5-
chartrepo=0 # by default don't create a new chart repo unless the version chart version includes "CI" suffix
6-
github=0 # by default don't use the Github repo unless the chart doesn't exist in the OCI registry
6+
# chartrepo=0 # by default don't create a new chart repo unless the version chart version includes "CI" suffix
77

88
usage ()
99
{
1010
echo "Usage: $0 CHART_VERSION [-n namespace]
1111
1212
Examples:
13-
$0 1.1.1
13+
$0 1.5.1
1414
$0 1.7-20-CI -n rhdh-ci
1515
1616
Options:
1717
-n, --namespace Project or namespace into which to install specified chart; default: $namespace
1818
--github-repo If set will use the deprecated github repository to install the helm chart instead of the OCI registry.
19-
--chartrepo If set, a Helm Chart Repo will be applied to the cluster, based on the chart version.
20-
If CHART_VERSION ends in CI and --github-repo is set, this is done by default.
2119
--router If set, the cluster router base is manually set.
2220
Required for non-admin users
2321
Redundant for admin users
2422
"
25-
exit
23+
# --chartrepo If set, a Helm Chart Repo will be applied to the cluster, based on the chart version.
24+
# If CHART_VERSION ends in CI, this is done by default.
2625
}
2726

28-
if [[ $# -lt 1 ]]; then usage; fi
27+
if [[ $# -lt 1 ]]; then usage; exit 0; fi
2928

3029
while [[ "$#" -gt 0 ]]; do
3130
case $1 in
32-
'--chartrepo') chartrepo=1;;
31+
# '--chartrepo') chartrepo=1;;
3332
'-n'|'--namespace') namespace="$2"; shift 1;;
34-
'-h') usage;;
35-
'--github-repo') github=1;;
33+
'-h') usage; exit 0;;
3634
'--router') CLUSTER_ROUTER_BASE="$2"; shift 1;;
3735
*) CV="$1";;
3836
esac
3937
shift 1
4038
done
4139

42-
if [[ ! "$CV" ]]; then usage; fi
40+
if [[ ! "$CV" ]]; then usage; exit 1; fi
4341

4442
CHART_URL="oci://quay.io/rhdh/chart"
4543

46-
if ! helm show chart $CHART_URL --version "$CV" &> /dev/null; then github=1; fi
47-
if [[ $github -eq 1 ]]; then
48-
# If a Github CI chart, create a chart repo
49-
if [[ "$CV" == *"-CI" ]]; then chartrepo=1; fi
50-
CHART_URL="https://github.com/rhdh-bot/openshift-helm-charts/raw/redhat-developer-hub-${CV}/charts/redhat/redhat/redhat-developer-hub/${CV}/redhat-developer-hub-${CV}.tgz"
51-
fi
44+
if ! helm show chart $CHART_URL --version "$CV" &> /dev/null; then
45+
echo "Error: could not load chart $CV from $CHART_URL !"
46+
echo
47+
usage
48+
exit 1
49+
fi
5250

5351
echo "Using ${CHART_URL} to install Helm chart"
5452

5553
# choose namespace for the install (or create if non-existant)
5654
oc new-project "$namespace" || oc project "$namespace"
5755

58-
if [[ $chartrepo -eq 1 ]]; then
59-
oc apply -f https://github.com/rhdh-bot/openshift-helm-charts/raw/redhat-developer-hub-"${CV}"/installation/rhdh-next-ci-repo.yaml
60-
fi
56+
# TODO: RHIDP-6668 generate rhdh-next-ci-repo.yaml while installing so we don't have to publish a new file every time
57+
# TODO: RHIDP-6668 publish an index.yaml with every tarball pushed to quay.io/rhdh/chart; save them in rhdh-chart repo (one per CI versioned branch)
58+
# if [[ "$CV" == *"-CI" ]] || [[ $chartrepo -eq 1 ]]; then
59+
# see samples at
60+
# https://github.com/rhdh-bot/openshift-helm-charts/blob/rhdh-1-rhel-9/installation/index.yaml#L19
61+
# https://github.com/rhdh-bot/openshift-helm-charts/blob/rhdh-1-rhel-9/installation/index.yaml#L49-L50
62+
# https://github.com/rhdh-bot/openshift-helm-charts/blob/rhdh-1-rhel-9/installation/rhdh-next-ci-repo.yaml#L8
63+
# oc apply -f https://github.com/redhat-developer/rhdh-chart/raw/redhat-developer-hub-"${CV}"/installation/rhdh-next-ci-repo.yaml
64+
# fi
6165

6266
# 1. install (or upgrade)
6367
helm upgrade redhat-developer-hub -i "${CHART_URL}" --version "$CV"

0 commit comments

Comments
 (0)