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
|
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}
|
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
|
|
|
|
2021-12-16 00:14:27 +00:00
|
|
|
curl --compressed -sfL https://github.com/k3s-io/k3s-root/releases/download/${VERSION_ROOT}/k3s-root-${ARCH}.tar | tar xf - --exclude=bin/socat
|
2019-03-20 00:21:49 +00:00
|
|
|
|
2021-12-16 00:14:27 +00:00
|
|
|
git clone --single-branch --branch=${VERSION_RUNC} --depth=1 https://github.com/opencontainers/runc ${RUNC_DIR}
|
2021-05-12 18:50:24 +00:00
|
|
|
|
2021-12-02 20:51:57 +00:00
|
|
|
git clone --single-branch --branch=${VERSION_CONTAINERD} --depth=1 https://github.com/k3s-io/containerd ${CONTAINERD_DIR}
|
|
|
|
|
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
|
2019-09-03 23:41:54 +00:00
|
|
|
|
|
|
|
cp scripts/wg-add.sh bin/aux/
|