Bug 1294234 - Add test-ubuntu*.sh scripts to Docker image; r=dustin

Before, we `curl`d these files at task run time. Why, I'm not sure.
Probably the easiest way to do things before we could add files outside
the directory of the Dockerfile to the image build context. Since that
is no longer a restriction, we just include the file as part of the
built image.

This does mean we rebuild the Docker image if the scripts change. I'm
fine with that.

It's worth noting that both test.sh files look very similar. I
anticipate consolidation in the future...

MozReview-Commit-ID: 48dinmxy6G0

--HG--
extra : rebase_source : 418f11ada7aaf16f3a4c3522f014b42690d44295
extra : histedit_source : df27ba0c3bbff1721d8b278ff65c127e6332cc28
This commit is contained in:
Gregory Szorc 2016-08-09 13:12:14 -07:00
Родитель 8c5a7a2568
Коммит 4d604a8b84
4 изменённых файлов: 8 добавлений и 38 удалений

Просмотреть файл

@ -17,6 +17,9 @@ RUN bash /setup/system-setup.sh
# %include testing/docker/recipes/run-task
ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task
# %include taskcluster/scripts/tester/test-ubuntu1204.sh
ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu1204.sh /home/worker/bin/test-linux.sh
# This will create a host mounted filesystem when the cache is stripped
# on Try. This cancels out some of the performance losses of aufs. See
# bug 1291940.

Просмотреть файл

@ -15,24 +15,6 @@ if [ $(id -u) = 0 ]; then
exec sudo -E -u worker bash /home/worker/bin/test.sh "${@}"
fi
fail() {
echo # make sure error message is on a new line
echo "[test.sh:error]" "${@}"
exit 1
}
####
# Now get the test-linux.sh script from the given Gecko tree and run it with
# the same arguments.
####
[ -d $WORKSPACE ] || mkdir -p $WORKSPACE
cd $WORKSPACE
script=taskcluster/scripts/tester/test-ubuntu1204.sh
url=${GECKO_HEAD_REPOSITORY}/raw-file/${GECKO_HEAD_REV}/${script}
if ! curl --fail -o ./test-linux.sh --retry 10 $url; then
fail "failed downloading test-linux.sh from ${GECKO_HEAD_REPOSITORY}"
fi
chmod +x ./test-linux.sh
exec ./test-linux.sh "${@}"
exec /home/worker/bin/test-linux.sh "${@}"

Просмотреть файл

@ -17,6 +17,9 @@ RUN bash /setup/system-setup.sh
# %include testing/docker/recipes/run-task
ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task
# %include taskcluster/scripts/tester/test-ubuntu1604.sh
ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu1604.sh /home/worker/bin/test-linux.sh
# This will create a host mounted filesystem when the cache is stripped
# on Try. This cancels out some of the performance losses of aufs. See
# bug 1291940.

Просмотреть файл

@ -15,24 +15,6 @@ if [ $(id -u) = 0 ]; then
exec sudo -E -u worker bash /home/worker/bin/test.sh "${@}"
fi
fail() {
echo # make sure error message is on a new line
echo "[test.sh:error]" "${@}"
exit 1
}
####
# Now get the test-linux.sh/test-ubuntu.sh script from the given Gecko tree
# and run it with the same arguments.
####
[ -d $WORKSPACE ] || mkdir -p $WORKSPACE
cd $WORKSPACE
script=taskcluster/scripts/tester/test-ubuntu1604.sh
url=${GECKO_HEAD_REPOSITORY}/raw-file/${GECKO_HEAD_REV}/${script}
if ! curl --fail -o ./test-linux.sh --retry 10 $url; then
fail "failed downloading test-ubuntu1604.sh from ${GECKO_HEAD_REPOSITORY}"
fi
chmod +x ./test-linux.sh
exec ./test-linux.sh "${@}"
exec /home/worker/bin/test-linux.sh "${@}"