-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathupdate.sh
executable file
·39 lines (29 loc) · 1019 Bytes
/
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
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -Eeuo pipefail
declare -a versions=("4.4.7" "5.0.7" "stable" "master")
for version in "${versions[@]}"; do
rt_dir=${version%.*}
mkdir -p "$rt_dir"
cp Dockerfile.template "${rt_dir}/Dockerfile"
cp docker-entrypoint.sh RT_SiteConfig.pm "$rt_dir"
if [[ "$version" =~ ^(master|stable)$ ]]; then
url="https://github.com/bestpractical/rt/archive/refs/heads/${version}.tar.gz"
if [[ "$version" == "master" ]]; then
version_tag="rt-6.0.${version}"
else
version_tag="rt-5.0.${version}"
fi
sed -i "s!%%RT_VERSION_TAG%%!$version_tag!" "${rt_dir}/Dockerfile"
else
if [[ "$version" =~ ^(alpha|beta)$ ]]; then
url="https://download.bestpractical.com/pub/rt/devel/rt-${version}.tar.gz"
else
url="https://download.bestpractical.com/pub/rt/release/rt-${version}.tar.gz"
fi
sed -i \
-e "/%%RT_VERSION_TAG%%/d" \
-e "/make fixdeps/d" \
"${rt_dir}/Dockerfile"
fi
sed -i "s!%%RT_URL%%!$url!" "${rt_dir}/Dockerfile"
done