Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
d201ffe1
Unverified
Commit
d201ffe1
authored
8 years ago
by
Vincent Petry
Browse files
Options
Downloads
Patches
Plain Diff
Fix webdav test env scripts to also work on CI
parent
5d7f37d5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/files_external/tests/env/start-webdav-apache.sh
+23
-7
23 additions, 7 deletions
apps/files_external/tests/env/start-webdav-apache.sh
apps/files_external/tests/env/stop-webdav-apache.sh
+1
-0
1 addition, 0 deletions
apps/files_external/tests/env/stop-webdav-apache.sh
with
24 additions
and
7 deletions
apps/files_external/tests/env/start-webdav-apache.sh
+
23
−
7
View file @
d201ffe1
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#
#
# @author Morris Jobke
# @author Morris Jobke
# @copyright 2014 Morris Jobke <hey@morrisjobke.de>
# @copyright 2014 Morris Jobke <hey@morrisjobke.de>
# @copyright 2016 Vincent Petry <pvince81@owncloud.com>
#
#
if
!
command
-v
docker
>
/dev/null 2>&1
;
then
if
!
command
-v
docker
>
/dev/null 2>&1
;
then
...
@@ -32,21 +33,36 @@ if [ -z "$thisFolder" ]; then
...
@@ -32,21 +33,36 @@ if [ -z "$thisFolder" ]; then
thisFolder
=
"."
thisFolder
=
"."
fi
;
fi
;
container
=
`
docker run
-d
-e
USERNAME
=
test
-e
PASSWORD
=
test
-p
8888:80 morrisjobke/webdav
`
if
[
-n
"
$RUN_DOCKER_MYSQL
"
]
;
then
echo
"Fetch recent mysql docker image"
docker pull mysql
# TODO find a way to determine the successful initialization inside the docker container
echo
"Setup MySQL ..."
echo
"Waiting 30 seconds for Webdav initialization ... "
# user/password will be read by ENV variables in owncloud container (they are generated by docker)
sleep
30
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
`
# get mapped port on host for internal port 80 - output is IP:PORT - we need to extract the port with 'cut'
parameter
=
"--link
$containerName
:db"
port
=
`
docker port
$container
80 |
cut
-f
2
-d
:
`
fi
container
=
`
docker run
-P
$parameter
-d
-e
USERNAME
=
test
-e
PASSWORD
=
test
morrisjobke/webdav
`
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
# wait at least 5 more seconds - sometimes the webserver still needs some additional time
sleep
5
cat
>
$thisFolder
/config.webdav.php
<<
DELIM
cat
>
$thisFolder
/config.webdav.php
<<
DELIM
<?php
<?php
return array(
return array(
'run'=>true,
'run'=>true,
'host'=>'
localhost:
$port
/webdav/',
'host'=>'
${
host
}
:80
/webdav/',
'user'=>'test',
'user'=>'test',
'password'=>'test',
'password'=>'test',
'root'=>'',
'root'=>'',
...
...
This diff is collapsed.
Click to expand it.
apps/files_external/tests/env/stop-webdav-apache.sh
+
1
−
0
View file @
d201ffe1
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#
#
# @author Morris Jobke
# @author Morris Jobke
# @copyright 2014 Morris Jobke <hey@morrisjobke.de>
# @copyright 2014 Morris Jobke <hey@morrisjobke.de>
# @copyright 2016 Vincent Petry <pvince81@owncloud.com>
#
#
if
!
command
-v
docker
>
/dev/null 2>&1
;
then
if
!
command
-v
docker
>
/dev/null 2>&1
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment