12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #!/bin/bash
- if ! command -v docker >/dev/null 2>&1; then
- echo "No docker executable found - skipped docker setup"
- exit 0;
- fi
- echo "Docker executable found - setup docker"
- echo "Fetch recent webdav docker image"
- docker pull ghcr.io/nextcloud/continuous-integration-webdav-apache:latest
- thisFolder=`echo $0 | sed 's#env/start-webdav-apache\.sh##'`
- if [ -z "$thisFolder" ]; then
- thisFolder="."
- fi;
- if [ -n "$RUN_DOCKER_MYSQL" ]; then
- echo "Fetch recent mysql docker image"
- docker pull mysql
- echo "Setup MySQL ..."
-
- databaseContainer=`docker run -e MYSQL_ROOT_PASSWORD=mysupersecretpassword -d mysql`
- containerName=`docker inspect $databaseContainer | grep Name | grep _ | cut -d \" -f 4 | cut -d / -f 2`
- parameter="--link $containerName:db"
- fi
- container=`docker run -P $parameter -d --rm ghcr.io/nextcloud/continuous-integration-webdav-apache:latest`
- host=`docker inspect --format="{{.NetworkSettings.IPAddress}}" $container`
- echo -n "Waiting for Apache initialization on ${host}:${port}"
- if ! "$thisFolder"/env/wait-for-connection ${host} 80 60; then
- echo "[ERROR] Waited 60 seconds, no response" >&2
- exit 1
- fi
- sleep 5
- cat > $thisFolder/config.webdav.php <<DELIM
- <?php
- return array(
- 'run'=>true,
- 'host'=>'${host}:80/webdav/',
- 'user'=>'test',
- 'password'=>'pass',
- 'root'=>'',
- // wait delay in seconds after write operations
- // (only in tests)
- // set to higher value for lighttpd webdav
- 'wait'=> 0
- );
- DELIM
- echo "Nextcloud container: $container"
- echo $container >> $thisFolder/dockerContainerWebdav.$EXECUTOR_NUMBER.webdav
- if [ -n "$databaseContainer" ]; then
- echo "Database container: $databaseContainer"
- echo $databaseContainer >> $thisFolder/dockerContainerWebdav.$EXECUTOR_NUMBER.webdav
- fi
- if [ -n "$DEBUG" ]; then
- cat $thisFolder/config.webdav.php
- cat $thisFolder/dockerContainerWebdav.$EXECUTOR_NUMBER.webdav
- fi
|