docker-mw-extra-commands.sh 2.1 KB
Newer Older
Addshore's avatar
Addshore committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash

set -e # Fail on errors
set -x # Output commands

# keep track of the last executed command
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
# echo an error message before exiting
trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT

# Create
./bin/mw docker mediawiki create

# Validate the basic stuff
./bin/mw docker docker-compose ps
./bin/mw docker env list
17
CURL=$(curl -s -L -N http://default.mediawiki.mwdd.localhost:8080) && echo $CURL && echo $CURL | grep -q "Is your database running and wiki database created"
Addshore's avatar
Addshore committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

# Install sqlite & check
./bin/mw docker mediawiki install
CURL=$(curl -s -L -N http://default.mediawiki.mwdd.localhost:8080) && echo $CURL && echo $CURL | grep -q "MediaWiki has been installed"

# docker-compose: Make sure it appears to work
./bin/mw docker docker-compose ps -- --services | grep -q "mediawiki"

# cd to mediawiki
cd mediawiki

# composer: Make sure a command works in root of the repo
./../bin/mw docker mediawiki composer home | grep -q "https://www.mediawiki.org/"
# phpunit: Make sure a command works in the root of the repo
./../bin/mw docker mediawiki phpunit ./tests/phpunit/unit/includes/PingbackTest.php
./../bin/mw docker mediawiki phpunit ./tests/phpunit/unit/includes/PingbackTest.php | grep -q "OK "
# exec: Make sure a command works in the root of the repo
./../bin/mw docker mediawiki exec ls | grep -q "api.php"

# cd to Vector
cd skins/Vector

# composer: Make sure a command works from the Vector directory
./../../../bin/mw docker mediawiki composer home | grep -q "http://gerrit.wikimedia.org/g/mediawiki/skins/Vector"
# phpunit: Make sure a command works from the Vector directory
./../../../bin/mw docker mediawiki phpunit ./../../tests/phpunit/unit/includes/PingbackTest.php | grep -q "OK "
# exec: Make sure a command works from the Vector directory
# Right now this just executes in the MediaWiki directory
./../../../bin/mw docker mediawiki exec ls | grep -q "api.php"

# cd back again
cd ./../../../

# Destroy it all
./bin/mw docker destroy
# And make sure only 1 exists after
docker ps
docker ps | wc -l | grep -q "1"