summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-04-15 13:28:59 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-04-19 08:26:04 +0200
commit34510b73a254a0c7c87ac631cdf2aa06d57d0c49 (patch)
treeb3d11da0465f83e07fe34ca86abd4de440a79951
parent7de82615ff495e7298f1c1dc4da31b7ebc965da5 (diff)
downloadnextcloud-server-34510b73a254a0c7c87ac631cdf2aa06d57d0c49.tar.gz
nextcloud-server-34510b73a254a0c7c87ac631cdf2aa06d57d0c49.zip
Extract installation and configuration of the Nextcloud server
The installation and configuration of the Nextcloud server as expected by the acceptance tests is extracted to its own script so it can be used from any element that launches the acceptance tests. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rwxr-xr-xbuild/acceptance/installAndConfigureServer.sh30
-rwxr-xr-xbuild/acceptance/run.sh4
2 files changed, 32 insertions, 2 deletions
diff --git a/build/acceptance/installAndConfigureServer.sh b/build/acceptance/installAndConfigureServer.sh
new file mode 100755
index 00000000000..c41f03ece16
--- /dev/null
+++ b/build/acceptance/installAndConfigureServer.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com)
+#
+# @license GNU AGPL version 3 or any later version
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Helper script to install and configure the Nextcloud server as expected by the
+# acceptance tests.
+#
+# This script is not meant to be called manually; it is called when needed by
+# the acceptance tests launchers.
+
+set -o errexit
+
+php occ maintenance:install --admin-pass=admin
+
+OC_PASS=123456 php occ user:add --password-from-env user0
diff --git a/build/acceptance/run.sh b/build/acceptance/run.sh
index a30d9fd8f3a..96ed9c8db4f 100755
--- a/build/acceptance/run.sh
+++ b/build/acceptance/run.sh
@@ -190,13 +190,13 @@ function prepareDocker() {
# to root).
echo "Copying local Git working directory of Nextcloud to the container"
tar --create --file="$NEXTCLOUD_LOCAL_TAR" --exclude=".git" --exclude="./build" --exclude="./config/config.php" --exclude="./data" --exclude="./tests" --directory=../../ .
+ tar --append --file="$NEXTCLOUD_LOCAL_TAR" --directory=../../ build/acceptance/installAndConfigureServer.sh
docker cp - $NEXTCLOUD_LOCAL_CONTAINER:/var/www/html/ < "$NEXTCLOUD_LOCAL_TAR"
docker exec $NEXTCLOUD_LOCAL_CONTAINER chown -R www-data:www-data /var/www/html/
echo "Installing Nextcloud in the container"
- docker exec --user www-data $NEXTCLOUD_LOCAL_CONTAINER php occ maintenance:install --admin-pass=admin
- docker exec --user www-data $NEXTCLOUD_LOCAL_CONTAINER bash -c "OC_PASS=123456 php occ user:add --password-from-env user0"
+ docker exec --user www-data $NEXTCLOUD_LOCAL_CONTAINER build/acceptance/installAndConfigureServer.sh
echo "Creating Docker image to be used in acceptance tests"
docker commit --message "Nextcloud installed from the local Git working directory" $NEXTCLOUD_LOCAL_CONTAINER $NEXTCLOUD_LOCAL_IMAGE