-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimport-stable.sh
More file actions
executable file
·32 lines (26 loc) · 1.13 KB
/
Copy pathimport-stable.sh
File metadata and controls
executable file
·32 lines (26 loc) · 1.13 KB
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
#!/bin/bash -e
# This script assumes that Helm 3 can be invoked with the "h3" command
# and that a registry is running at localhost:5000
mkdir -p stable/
cd stable/
# Add stable repo (in case it aint there)
helm repo add stable https://kubernetes-charts.storage.googleapis.com
# download all charts latest versions (stable) then save and push them to local registry
for chart in $(helm search stable | tail -n +2 | awk '{print $1}'); do
name="$(echo $chart | cut -d '/' -f2)"
ref="localhost:5000/stable/$name:latest"
if [ ! -d $name ]; then
echo "------------------------------------------------------"
echo "+ helm fetch $chart --untar"
helm fetch $chart --untar || echo "Issue fetching $chart"
fi
echo "------------------------------------------------------"
echo "+ h3 chart save $name $chart"
h3 chart save $name $ref || echo "Issue saving $ref"
echo "------------------------------------------------------"
echo "+ h3 chart push $ref"
h3 chart push $ref || echo "Issue pushing $ref"
done
echo "------------------------------------------------------"
echo "+ h3 chart list"
h3 chart list