forked from docker-library/buildpack-deps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·45 lines (41 loc) · 1.27 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -eo pipefail
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then
versions=( */ )
fi
versions=( "${versions[@]%/}" )
travisEnv=
for version in "${versions[@]}"; do
if bashbrew list "https://github.com/docker-library/official-images/raw/master/library/debian:$version" &> /dev/null; then
dist='debian'
elif bashbrew list "https://github.com/docker-library/official-images/raw/master/library/ubuntu:$version" &> /dev/null; then
dist='ubuntu'
else
echo >&2 "error: cannot determine repo for '$version'"
exit 1
fi
echo "$version: $dist"
for variant in curl scm ''; do
src="Dockerfile${variant:+-$variant}.template"
trg="$version${variant:+/$variant}/Dockerfile"
mkdir -p "$(dirname "$trg")"
sed \
-e 's!DIST!'"$dist"'!g' \
-e 's!SUITE!'"$version"'!g' \
"$src" > "$trg"
if [ "$dist" = 'debian' ]; then
# remove "bzr" from buster and later
case "$version" in
wheezy|jessie|stretch) echo ' - how bizarre (still includes "bzr")' ;;
*)
sed -i '/bzr/d' "$version/scm/Dockerfile"
;;
esac
fi
done
travisEnv+='\n - VERSION='"$version"
done
travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
echo "$travis" > .travis.yml