diff options
author | Ryan Chu <ryan.chu@qt.io> | 2019-03-22 16:20:52 +0100 |
---|---|---|
committer | Ryan Chu <ryan.chu@qt.io> | 2019-04-25 15:32:57 +0000 |
commit | 713f77176e5de34503bd265e00f665b7f6ef05b4 (patch) | |
tree | 7be1f245a087bca7385676b2af6d038461a48d38 /tests/testserver/common | |
parent | 0c404fd6f34c7ca75400324e95e44842152bdd87 (diff) |
Support multi-stage builds to provision the configurations and test data
In order to reuse the test server to the external modules, it is much
easier to share the common configurations (scripts) and test data via
Dockerfile. In addition, the external module can create more layers
depending on their needs. Therefore, supporting multi-stage builds is
needed. The disadvantage is that the docker-compose needs to re-build
the images every time. However, it is just a one-time effort. If the
Dockerfile doesn't get changed, the extra build time can be ignored.
Because of multi-stage builds, the test server will keep a Dockerfile at
least. Therefore, the volume sharing is no more needed. The test data of
a service can be added into the images by using COPY/ADD commands.
NOTE:
This patch relies on docker-compose v1.21.0 (docker-compose build now
supports the use of Dockerfile from outside the build context).
Change-Id: Ib3f6a5fcf6979732ae8a40a494a1360fca4ac7bf
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/testserver/common')
-rwxr-xr-x | tests/testserver/common/startup.sh | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/tests/testserver/common/startup.sh b/tests/testserver/common/startup.sh index 74990a47f6..1386314e38 100755 --- a/tests/testserver/common/startup.sh +++ b/tests/testserver/common/startup.sh @@ -34,7 +34,7 @@ set -ex # export variables export USER=qt-test-server export PASS=password -export CONFIG=common/testdata +export CONFIG=service/testdata export TESTDATA=service/testdata # add users @@ -43,17 +43,4 @@ useradd -m -s /bin/bash $USER; echo "$USER:$PASS" | chpasswd # install configurations and test data su $USER -c "cp $CONFIG/system/passwords ~/" -# modules initialization (apache2.sh, ftp-proxy.sh ...) -for RUN_CMD -do $RUN_CMD -done - -# start multicast DNS service discovery (mDNS) -sed -i -e "s,#domain-name=local,domain-name=${test_domain:-test-net.qt.local}," \ - -e "s,#publish-aaaa-on-ipv4=yes,publish-aaaa-on-ipv4=no," \ - /etc/avahi/avahi-daemon.conf -service dbus restart -service avahi-daemon restart - -# keep-alive in docker detach mode -sleep infinity +./startup.sh "$@" |