forked from OT-CONTAINER-KIT/redis-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredis-operator.chart
34 lines (32 loc) · 4.77 KB
/
redis-operator.chart
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
#!/usr/bin/env bash
set -e
if ! grep "^$chart-$version.tgz$" ".cached.${0##*.}" >/dev/null 2>&1; then
wget -qO- https://github.com/OT-CONTAINER-KIT/helm-charts/archive/refs/tags/$chart-$version.tar.gz | tar --strip-components=2 -xz helm-charts-$chart-$version/charts/$chart
MANAGER_YAML="$(grep containers: -rl "$chart")"
if [ -z "$MANAGER_YAML" ]; then echo "manager.yaml error" && exit; fi
cat <<EOF >"$chart/Chart.yaml"
apiVersion: v2
appVersion: $version
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
name: redis-operator
version: $(date +%F | sed 's~-~.~g;s~\.0~.~g')
EOF
echo H4sIAAAAAAAAA+1ZbXPaSBLOZ/2KXpnEkI0kZGNIyDpVHMZZbjH4wM7eVjZFCWmAKQtJ0Uh2WMz99uvRSEjC8ktSye4XxlUgSz3d0z3dTz8jiBP4S8+lTqCy+bMfM6o4GkdH4rsuvquNmviu6odH+Eyv1asHtcZB7bD+rKrrdV1/BtUftJ7cCFlg+ACPys2MBWE/fjl/99j7SZtQR2NzSWIkAIVIkk8My3XsJQyJRdkJ9Y9lzTICQ06fdP570Rn2W73x2eCyf4HPSWBqPhfXyJeA+I5hq6brTFVLlqRh56Q7ave649blxa/HcmkV3Rift0aj3wfDk6ZSykmsZTFjfNb692A4/tAZjrqD/nGpHOlXGPGviQ+Kgp+Mug7cgnFzBfsrz8ckhtLheh9vMWLBPtOONW0/FlBO1VRIj4TMEB22rkGZHlQkyTQYgdKoM0SL6NdJB6iDMXEC6hC7IgFsvI9lzgfDC+5O5t+mclA/bLxBFzLiURjbGA0UTkKqZQ1FoeJT3r6VXj7Z0hMNRVHLWiDMMLm3AfzyS2dw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ONf2DLjAuV1ez44GXfPkfUnRQlKd5t168il8mS44OCfK8O4rykdbG2LJSP2VGMafKwqb9RPPzc1KAmzTU2+R1vCYR+Bnxh6og0ujS4h9xo2W2CcWW+/WKKcp4qFFD7fREROoxNzygivXn4v46nKGP7wOstqnmQhmZBhPY/Py7Chf/plf8HA8vBsIyBMI+kvQUtjYX9HG5xv1mu1e37/qVZrjfozvXZUO9KPavVG41lVr+kovvv9528Yhkc/iB9SmnCtS/x3nqa0WikcichnUNtzhES1z0tUHRKbIFaI/9ZrFIOyeopdkqnvEXxBJtkfE+WK2ooqgM4Q7LBp4lM4EPOU6JzNryfUMfzlSWz2UX0jYvoEiV+BQuxbeHmF95sgzJ4ZnrQggSGcAuDg0oSMUvHbiPh0PRYgmtvGhKkR7nHp6ITeBFxYznlxcEdr//Tu7cZu7MZu7MZu7MZu7MZufN34P9pQ3bsAKAAA | base64 -d | tar -C "$chart" -xzv
readonly oem=redis.opstreelabs.in
OEM=${OEM:-$oem}
echo "OEM: $OEM"
echo "GRP: redis.$OEM for CRDs."
grep opstreelabs.in -rl | grep -E "(rbac.go|groupversion_info.go|/config/|chart/|$chart/|values.redis-operator.yaml)" | while read -r f; do
sed "s~redis.$oem~redis.$OEM~g;s~$oem~$OEM~g" <"$f" >"$f.repl"
mv "$f.repl" "$f"
done
sed 's~^ - services~ - services\n - endpoints~' "$chart/templates/role.yaml" >f && mv f "$chart/templates/role.yaml"
make install
cp -a "$(grep 'kind: Redis$' -rl config/crd | grep "/redis.$OEM")" "$chart/crds/redis.yaml"
cp -a "$(grep 'kind: RedisReplication$' -rl config/crd | grep "/redis.$OEM")" "$chart/crds/redis-replication.yaml"
cp -a "$(grep 'kind: RedisSentinel$' -rl config/crd | grep "/redis.$OEM")" "$chart/crds/redis-sentinel.yaml"
cp -a "$(grep 'kind: RedisCluster$' -rl config/crd | grep "/redis.$OEM")" "$chart/crds/redis-cluster.yaml"
tar -zcf "$chart-$version.tgz" "$chart"
$(which rm) -rf "$chart"
echo "$chart-$version.tgz" >>".cached.${0##*.}"
fi