-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.sh
executable file
·30 lines (21 loc) · 1.16 KB
/
init.sh
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
#! /bin/bash
set -e
path=`dirname $0`
HelmVersion=`cat ${path}/components.txt |grep "Helm" |awk '{print $3}'`
IstioVersion=`cat ${path}/components.txt |grep "Istio" |awk '{print $3}'`
curl -o ${path}/file/helm-linux-amd64.tar.gz https://get.helm.sh/helm-v${HelmVersion}-linux-amd64.tar.gz
echo "=== helm binary package is saved successfully ==="
curl -L -o ${path}/file/istio-$IstioVersion-origin.tar.gz https://github.com/istio/istio/releases/download/$IstioVersion/istio-$IstioVersion-linux.tar.gz
echo "=== Istio source code packag is saved successfully ==="
cd ${path}/file/
tar zxf istio-$IstioVersion-origin.tar.gz
cat istio-$IstioVersion/install/kubernetes/istio-demo.yaml |grep "image:" |grep -v '\[\[' |grep -v '{' |awk -F':' '{print $2":"$3}' |awk -F "[\"\"]" '{print $2}' |awk '!a[$0]++{print}' > images-list.txt
#echo "istio/proxy_init:"${IstioVersion} >> images-list.txt
echo "ubuntu:xenial" >> images-list.txt
echo 'Images list for Istio:'
cat images-list.txt
for file in $(cat images-list.txt); do docker pull $file; done
echo 'Images pulled.'
docker save $(cat images-list.txt) -o istio-images-$IstioVersion.tar
echo 'Images saved.'
rm -rf istio-$IstioVersion