aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64
diff options
context:
space:
mode:
authorRyan Chu <ryan.chu@qt.io>2018-03-06 14:37:35 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2018-07-02 19:20:21 +0000
commit2b6f5f165dd91a9983d44c2ba432aadd256541b9 (patch)
tree9b43c305da21709e1100f8bbc116858174c9fb63 /coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64
parentc6d9e433dfa899890b4279c773779659f8cb2626 (diff)
Provisioning: Install Docker-based test servers on Ubuntu 16.04
Build and cache docker images based on the configurations in testserver. 1. Download and install the docker engine and docker-compose extension. 2. Append address and hostname of test servers to CI environment. 3. Build and tag the docker images by the SHA-1 of server context. Task-number: QTQAINFRA-1686 Change-Id: Ib9b58d45856682ddec04af045e1eab18e14a85fb Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64')
-rwxr-xr-xcoin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/80-docker.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/80-docker.sh b/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/80-docker.sh
new file mode 100755
index 00000000..18c106ae
--- /dev/null
+++ b/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/80-docker.sh
@@ -0,0 +1,62 @@
+#!/usr/bin/env bash
+
+#############################################################################
+##
+## Copyright (C) 2017 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the provisioning scripts of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL21$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 2.1 or version 3 as published by the Free
+## Software Foundation and appearing in the file LICENSE.LGPLv21 and
+## LICENSE.LGPLv3 included in the packaging of this file. Please review the
+## following information to ensure the GNU Lesser General Public License
+## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+##
+## As a special exception, The Qt Company gives you certain additional
+## rights. These rights are described in The Qt Company LGPL Exception
+## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+set -ex
+
+# Download and install the docker engine.
+sudo apt-get install curl -y
+curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
+sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
+sudo apt-get update
+sudo apt-get install docker-ce -y
+sudo usermod -a -G docker $USER
+sudo docker info
+
+# Download and install the docker-compose extension.
+sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
+sudo chmod +x /usr/local/bin/docker-compose
+
+# Append address and hostname of test servers to CI environment.
+cat <<EOF | sudo tee -a /etc/hosts
+# Docker-based network test servers
+172.18.0.2 apache2.test-net.qt
+172.18.0.3 squid.test-net.qt
+172.18.0.4 vsftpd.test-net.qt
+172.18.0.5 ftp-proxy.test-net.qt
+172.18.0.6 danted.test-net.qt
+EOF
+
+# Start testserver provisioning
+source "${BASH_SOURCE%/*}/../common/linux/testserver/docker_testserver.sh"