forked from archlinux/archwiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
67 lines (54 loc) · 1.76 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
56
57
58
59
60
61
62
63
64
65
66
67
export PORT := '8081'
export UID := `id -u`
export GID := `id -g`
COMPOSE := 'docker-compose -f docker/app.yml -p archwiki'
COMPOSE-RUN := COMPOSE + ' run --rm'
PHP-DB-RUN := COMPOSE-RUN + ' app'
PHP-RUN := COMPOSE-RUN + ' --no-deps app'
MARIADB-RUN := COMPOSE-RUN + ' --no-deps mariadb'
default:
just --list
# Installs MediaWiki and creates LocalSettings.php
init: start
rm -f LocalSettings.php
{{PHP-DB-RUN}} php maintenance/install.php \
--dbserver "mariadb" \
--dbuser "root" \
--dbpass "" \
--installdbpass "" \
--dbname "archwiki" \
--scriptpath "" \
--pass "adminpassword" \
--server "http://localhost:${PORT}" \
"ArchWiki" \
"admin"
echo -e "\$wgVectorResponsive = true;\n\$wgVectorDefaultSkinVersion = '2';\nwfLoadExtension( 'ArchLinux' );" >> LocalSettings.php
echo -e "\$wgArchHome = 'https://www.archlinux.org/';" >> LocalSettings.php
echo -e "\$wgArchNavBar = ['Start' => '#', 'Wiki' => '/'];" >> LocalSettings.php
echo -e "\$wgArchNavBarSelectedDefault = 'Wiki';" >> LocalSettings.php
# Load a (gzipped) database backup for local testing
import-db-dump file name='archwiki': start
{{MARIADB-RUN}} mysqladmin -uroot -hmariadb drop -f {{name}} || true
{{MARIADB-RUN}} mysqladmin -uroot -hmariadb create {{name}}
zcat {{file}} | {{MARIADB-RUN}} mysql -uroot -hmariadb {{name}}
{{PHP-RUN}} php maintenance/update.php --quick
start:
{{COMPOSE}} up -d
{{MARIADB-RUN}} mysqladmin -uroot -hmariadb --wait=10 ping
@echo URL: http://localhost:${PORT}
stop:
{{COMPOSE}} stop
clean:
{{COMPOSE}} down -v
git clean -fdqx -e .idea
rebuild: clean
{{COMPOSE}} build --pull --parallel
just init
just stop
compose *args:
{{COMPOSE}} {{args}}
compose-run *args:
{{COMPOSE-RUN}} {{args}}
php *args='-h':
{{PHP-RUN}} php {{args}}
# vim: set ft=make :