2019-01-24 17:51:14 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-11-18 01:23:31 +00:00
|
|
|
set -ex
|
2021-11-22 23:30:06 +00:00
|
|
|
|
2019-01-24 17:51:14 +00:00
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
2019-11-12 23:36:04 +00:00
|
|
|
. ./scripts/version.sh
|
|
|
|
|
2022-11-18 01:23:31 +00:00
|
|
|
CHARTS_URL=https://k3s.io/k3s-charts/assets
|
2019-03-20 00:21:49 +00:00
|
|
|
CHARTS_DIR=build/static/charts
|
2021-05-17 20:30:55 +00:00
|
|
|
RUNC_DIR=build/src/github.com/opencontainers/runc
|
2021-12-02 20:51:57 +00:00
|
|
|
CONTAINERD_DIR=build/src/github.com/containerd/containerd
|
2023-10-16 18:53:09 +00:00
|
|
|
HCSSHIM_DIR=build/src/github.com/microsoft/hcsshim
|
2021-04-08 22:33:15 +00:00
|
|
|
DATA_DIR=build/data
|
|
|
|
export TZ=UTC
|
2019-03-20 00:21:49 +00:00
|
|
|
|
2021-04-08 22:33:15 +00:00
|
|
|
umask 022
|
2021-05-17 20:30:55 +00:00
|
|
|
rm -rf ${CHARTS_DIR}
|
|
|
|
rm -rf ${RUNC_DIR}
|
2021-12-02 20:51:57 +00:00
|
|
|
rm -rf ${CONTAINERD_DIR}
|
2023-10-16 18:53:09 +00:00
|
|
|
rm -rf ${HCSSHIM_DIR}
|
2019-03-20 00:21:49 +00:00
|
|
|
mkdir -p ${CHARTS_DIR}
|
2021-04-08 22:33:15 +00:00
|
|
|
mkdir -p ${DATA_DIR}
|
2019-03-20 00:21:49 +00:00
|
|
|
|
2023-10-16 18:53:09 +00:00
|
|
|
case ${OS} in
|
|
|
|
linux)
|
|
|
|
git clone --single-branch --branch=${VERSION_RUNC} --depth=1 https://github.com/opencontainers/runc ${RUNC_DIR}
|
|
|
|
curl --compressed -sfL https://github.com/k3s-io/k3s-root/releases/download/${VERSION_ROOT}/k3s-root-${ARCH}.tar | tar xf -
|
|
|
|
cp scripts/wg-add.sh bin/aux
|
|
|
|
;;
|
|
|
|
windows)
|
|
|
|
git clone --single-branch --branch=${VERSION_HCSSHIM} --depth=1 https://github.com/microsoft/hcsshim ${HCSSHIM_DIR}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "[ERROR] unrecognized opertaing system: ${OS}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2021-05-12 18:50:24 +00:00
|
|
|
|
2023-09-19 13:18:47 +00:00
|
|
|
git clone --single-branch --branch=${VERSION_CONTAINERD} --depth=1 https://${PKG_CONTAINERD_K3S} ${CONTAINERD_DIR}
|
2021-12-02 20:51:57 +00:00
|
|
|
|
2022-11-18 01:23:31 +00:00
|
|
|
for CHART_FILE in $(grep -rlF HelmChart manifests/ | xargs yq eval --no-doc .spec.chart | xargs -n1 basename); do
|
|
|
|
CHART_NAME=$(echo $CHART_FILE | grep -oE '^(-*[a-z])+')
|
|
|
|
curl -sfL ${CHARTS_URL}/${CHART_NAME}/${CHART_FILE} -o ${CHARTS_DIR}/${CHART_FILE}
|
|
|
|
done
|