Add OVN-Kubernetes CNI Installation for IEC
[iec.git] / src / foundation / scripts / cni / ovn-kubernetes / push-manifest.sh
1 #!/bin/bash
2
3 #Supported platforms of multi-arch images are: amd64 arm64
4 LINUX_ARCH=(amd64 arm64)
5 PLATFORMS=linux/${LINUX_ARCH[0]}
6 for i in $(seq 1  $[${#LINUX_ARCH[@]}-1])
7 do
8     PLATFORMS=$PLATFORMS,linux/${LINUX_ARCH[$i]}
9 done
10
11 IMAGES_OVN=("ovn-daemonset")
12 #IMAGES_OVN=("ovn-daemonset" "ovn-daemonset-u")
13 BRANCH_TAG=latest
14
15 #Before push, 'docker login' is needed
16 push_multi_arch(){
17
18        if [ ! -f "./manifest-tool" ]
19        then
20                 sudo apt-get install -y jq
21                 wget https://github.com/estesp/manifest-tool/releases/download/v0.9.0/manifest-tool-linux-${BUILDARCH} \
22                 -O manifest-tool && \
23                 chmod +x ./manifest-tool
24        fi
25
26        for IMAGE in "${IMAGES_OVN[@]}"
27        do
28          echo "multi arch image: ""iecedge/${IMAGE}"
29          ./manifest-tool push from-args --platforms ${PLATFORMS} --template iecedge/${IMAGE}-ARCH:${BRANCH_TAG} \
30                 --target iecedge/${IMAGE}:${BRANCH_TAG}
31        done
32 }
33
34 echo "Push fat manifest for multi-arch images:"
35 push_multi_arch
36