Skip to content

Commit 83416f6

Browse files
committed
add file to test install script
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
1 parent 0e3674d commit 83416f6

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

contrib/builder/deb/debian-wheezy/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
33
#
44

5-
FROM debian:wheezy
6-
RUN echo deb http://http.debian.net/debian wheezy-backports main > /etc/apt/sources.list.d/wheezy-backports.list
5+
FROM debian:wheezy-backports
76

87
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
98

contrib/builder/deb/generate.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ for version in "${versions[@]}"; do
2222
suite="${version##*-}"
2323
from="${distro}:${suite}"
2424

25+
case "$from" in
26+
debian:wheezy)
27+
# add -backports, like our users have to
28+
from+='-backports'
29+
;;
30+
esac
31+
2532
mkdir -p "$version"
2633
echo "$version -> FROM $from"
2734
cat > "$version/Dockerfile" <<-EOF
@@ -32,13 +39,6 @@ for version in "${versions[@]}"; do
3239
FROM $from
3340
EOF
3441

35-
case "$from" in
36-
debian:wheezy)
37-
# add -backports, like our users have to
38-
echo "RUN echo deb http://http.debian.net/debian $suite-backports main > /etc/apt/sources.list.d/$suite-backports.list" >> "$version/Dockerfile"
39-
;;
40-
esac
41-
4242
echo >> "$version/Dockerfile"
4343

4444
extraBuildTags=

hack/make/test-install-script

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
# This script is used for testing install.sh and that it works for
3+
# each of component of our apt and yum repos
4+
set -e
5+
6+
test_install_script(){
7+
# these are equivalent to main, testing, experimental components
8+
# in the repos, but its the url that will do the conversion
9+
components=( experimental test get )
10+
11+
for component in "${components[@]}"; do
12+
# change url to specific component for testing
13+
local test_url=https://${component}.docker.com
14+
local script=$(mktemp /tmp/install-XXXXXXXXXX.sh)
15+
sed "s,url='https://get.docker.com/',url='${test_url}/'," hack/install.sh > "${script}"
16+
17+
chmod +x "${script}"
18+
19+
# test for each Dockerfile in contrib/builder
20+
for dir in contrib/builder/*/*/; do
21+
local from="$(awk 'toupper($1) == "FROM" { print $2; exit }' "$dir/Dockerfile")"
22+
23+
echo "running install.sh for ${component} with ${from}"
24+
docker run --rm -it -v ${script}:/install.sh ${from} /install.sh
25+
done
26+
done
27+
}
28+
29+
test_install_script

0 commit comments

Comments
 (0)