-
Notifications
You must be signed in to change notification settings - Fork 10
/
update.sh
executable file
·44 lines (35 loc) · 980 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
40
41
42
43
44
#!/bin/bash
#set -e
set -x
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( "$@" )
# Usage
# ./update.sh "6.4.14-1 6.4.16-rc1"
if [ ${#versions[@]} -eq 0 ]; then
versions=( */ )
fi
versions=( "${versions[@]%/}" )
travisEnv=
for full_version in "${versions[@]}"; do
major_version=$(echo "$full_version" | cut -d '.' -f1)
version=$(echo "$full_version" | cut -d '-' -f1)
maturity=$(echo "$full_version" | cut -d '-' -f2)
dir="${major_version}"
if [ "${maturity:0:2}" = "rc" ]
then
dir="${dir}-rc"
elif [ "${maturity:0:4}" = "beta" ]
then
dir="${dir}-beta"
fi
#echo "Major version: ${major_version}"
#echo "Version: ${version}"
(
set -x
sed -ri \
-e 's/^(ENV VERSION) .*/\1 '"${version}"'/' \
-e 's/^(ENV FULL_VERSION) .*/\1 '"${full_version}"'/' \
"$dir"/{,platform/centos/}Dockerfile
echo "$dir"/{,platform/centos/} | xargs -n 1 cp docker-entrypoint.sh
)
done