forked from metal-stack/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·29 lines (25 loc) · 1.09 KB
/
update.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
#!/usr/bin/env bash
set -exo pipefail
version=$1
function update_repo() {
path=$1
git_url=$2
ref=$3
echo "Updating repository ${path}"
rm -rf $path
mkdir -p $path
pushd $path
cd ..
git clone $git_url --depth 1 --branch $ref --single-branch
cd -
rm -rf .git
find . -type f ! \( -name "*.md" -o -name "*.png" -o -name "*.svg" \) -delete
popd
}
echo "Getting release vector"
curl -Lo /tmp/release.yaml "https://raw.githubusercontent.com/metal-stack/releases/${version}/release.yaml"
echo "Updating external repositories"
update_repo "docs/src/external/csi-lvm" "https://github.com/metal-stack/csi-lvm.git" $(yq r /tmp/release.yaml 'docker-images.metal-stack.kubernetes.csi-lvm-controller.tag')
update_repo "docs/src/external/mini-lab" "https://github.com/metal-stack/mini-lab.git" "master"
update_repo "docs/src/external/metalctl" "https://github.com/metal-stack/metalctl.git" $(yq r /tmp/release.yaml 'binaries.metal-stack.metalctl.version')
update_repo "docs/src/external/firewall-controller" "https://github.com/metal-stack/firewall-controller.git" "master"