-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild-push-bundle.sh
More file actions
60 lines (50 loc) · 2.04 KB
/
Copy pathbuild-push-bundle.sh
File metadata and controls
60 lines (50 loc) · 2.04 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
set -ex
echo 'alias shasum="sha512sum"' >> ~/.bashrc
source ~/.bashrc
export BUILD_ONLY=${BUILD_ONLY:-1}
export CONTAINERD_VERSION=${CONTAINERD_VERSION:-1.7.26}
export RUNC_VERSION=${RUNC_VERSION:-1.2.5}
export KUBERNETES_VERSION=${KUBERNETES_VERSION:-1.32.2}
export KUBERNETES_MAJOR_VERSION=${KUBERNETES_MAJOR_VERSION:-v1.32}
export BUNDLE_VERSION=${BUNDLE_VERSION:-v1.32.2}
export ARCH=${ARCH:-amd64}
export CRITOOL_VERSION=${CRITOOL_VERSION:-1.32.0}
export UBUNTU_VERSION=${UBUNTU_VERSION:-"22.04"} # Default to 22.04, can be overridden
export OS=${OS:-linux}
export CNI_VERSION=${CNI_VERSION:-1.3.0}
#alias shasum="sha512sum"
echo "installing imgpkg"
curl -LO https://github.com/carvel-dev/imgpkg/releases/download/v0.43.1/imgpkg-linux-amd64
mv imgpkg-linux-amd64 installer/bundle_builder/imgpkg
chmod +x installer/bundle_builder/imgpkg
cd installer/bundle_builder
echo "building docker image to create byoh-bundle"
docker build -t byoh-bundle .
docker rm -f byoh-bundle-container
echo "executing docker image"
docker run -e CRITOOL_VERSION -e BUILD_ONLY -e CONTAINERD_VERSION -e RUNC_VERSION -e KUBERNETES_VERSION -e KUBERNETES_MAJOR_VERSION -e ARCH -e UBUNTU_VERSION -e OS -e CNI_VERSION --name byoh-bundle-container -i byoh-bundle /bin/bash
echo "creating bundle dir to push k8s packages"
mkdir -p ./bundle
echo "coping bundle from docker image"
docker cp byoh-bundle-container:/bundle/. ./bundle/
# Determine bundle name based on Ubuntu version
case "$UBUNTU_VERSION" in
"20.04")
BUNDLE_NAME="byoh-bundle-ubuntu_20.04.1_x86-64_k8s"
;;
"22.04")
BUNDLE_NAME="byoh-bundle-ubuntu_22.04_x86-64_k8s"
;;
"24.04")
BUNDLE_NAME="byoh-bundle-ubuntu_24.04_x86-64_k8s"
;;
*)
echo "Error: Unsupported Ubuntu version '$UBUNTU_VERSION'"
echo "Supported versions are: 20.04, 22.04, 24.04"
docker rm byoh-bundle-container
exit 1
;;
esac
# Push bundle
echo "pushing oci bundle to quay.io/platform9/$BUNDLE_NAME"
./imgpkg push -f ./bundle -i quay.io/platform9/$BUNDLE_NAME:$BUNDLE_VERSION