docker-mw-extra-commands.sh 1.92 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

# Install sqlite & check
20
./bin/mw docker mediawiki install --dbtype sqlite
Addshore's avatar
Addshore committed
21
22
23
24
25
26
27
28
29
30
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/"
Addshore's avatar
Addshore committed
31
32
33
# exec phpunit: Make sure using exec to run phpunit things works
./../bin/mw docker mediawiki exec -- composer phpunit tests/phpunit/unit/includes/PingbackTest.php
./../bin/mw docker mediawiki exec -- composer phpunit tests/phpunit/unit/includes/PingbackTest.php | grep -q "OK "
Addshore's avatar
Addshore committed
34
35
36
37
38
39
40
41
42
# 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"
# exec: Make sure a command works from the Vector directory
Addshore's avatar
Addshore committed
43
./../../../bin/mw docker mediawiki exec ls | grep -q "skin.json"
Addshore's avatar
Addshore committed
44
45
46
47
48
49
50
51
52

# 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"