-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
147 lines (123 loc) · 4.58 KB
/
Dockerfile
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
ARG MW_VERSION
ARG PHP_VERSION
FROM gesinn/mediawiki-ci:${MW_VERSION}-php${PHP_VERSION}
ARG EXTENSION
ARG MW_INSTALL_PATH
ARG MW_VERSION
ARG PHP_VERSION
ARG PHP_EXTENSIONS
ARG OS_PACKAGES
ENV EXTENSION=${EXTENSION}
ENV MW_INSTALL_PATH=${MW_INSTALL_PATH}
ENV PHP_EXTENSIONS=${PHP_EXTENSIONS}
ENV OS_PACKAGES=${OS_PACKAGES}
# get needed dependencies for this extension
RUN sed -i s/80/8080/g /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf
### SemanticMediaWiki
ARG SMW_VERSION
RUN if [ ! -z "${SMW_VERSION}" ]; then \
composer-require.sh mediawiki/semantic-media-wiki ${SMW_VERSION} && \
echo 'wfLoadExtension( "SemanticMediaWiki" );\n' \
'enableSemantics( $wgServer );\n' \
>> __setup_extension__; \
fi
### SemanticMediaWiki
### PageForms
ARG PF_VERSION
ARG PF_REPO
RUN if [ ! -z "${PF_VERSION}" ]; then \
get-github-extension.sh PageForms ${PF_VERSION} ${PF_REPO} && \
echo 'wfLoadExtension( "PageForms" );\n' >> __setup_extension__; \
fi
### PageForms
### PageSchemas
ARG PS_VERSION
RUN if [ ! -z "${PS_VERSION}" ]; then \
get-github-extension.sh PageSchemas ${PS_VERSION} && \
echo 'wfLoadExtension( "PageSchemas" );\n' >> __setup_extension__; \
fi
### PageSchemas
### DisplayTitle
ARG DT_VERSION
RUN if [ ! -z "${DT_VERSION}" ]; then \
get-github-extension.sh DisplayTitle ${DT_VERSION} && \
echo 'wfLoadExtension( "DisplayTitle" );\n' >> __setup_extension__; \
fi
### DisplayTitle
### AdminLinks
ARG AL_VERSION
RUN if [ ! -z "${AL_VERSION}" ]; then \
get-github-extension.sh AdminLinks ${AL_VERSION} && \
echo 'wfLoadExtension( "AdminLinks" );\n' >> __setup_extension__; \
fi
### AdminLinks
### Maps
ARG MAPS_VERSION
RUN if [ ! -z "${MAPS_VERSION}" ]; then \
composer-require.sh mediawiki/maps ${MAPS_VERSION} && \
echo 'wfLoadExtension( "Maps" );\n' >> __setup_extension__; \
fi
### Maps
### SemanticResultFormats
ARG SRF_VERSION
RUN if [ ! -z "${SRF_VERSION}" ]; then \
composer-require.sh mediawiki/semantic-result-formats ${SRF_VERSION} && \
echo 'wfLoadExtension( "SemanticResultFormats" );\n' >> __setup_extension__; \
fi
### SemanticResultFormats
### Mermaid
ARG MM_VERSION
RUN if [ ! -z "${MM_VERSION}" ]; then \
composer-require.sh mediawiki/mermaid ${MM_VERSION} && \
echo 'wfLoadExtension( "Mermaid" );\n' >> __setup_extension__; \
fi
### Mermaid
### Lingo
ARG LINGO_VERSION
RUN if [ ! -z "${LINGO_VERSION}" ]; then \
composer-require.sh mediawiki/lingo ${LINGO_VERSION} && \
echo 'wfLoadExtension( "Lingo" );\n' >> __setup_extension__; \
fi
### Lingo
### Scribunto
ARG SCRIBUNTO_VERSION
RUN if [ ! -z "${SCRIBUNTO_VERSION}" ]; then \
get-github-extension.sh Scribunto ${SCRIBUNTO_VERSION} && \
echo 'wfLoadExtension( "Scribunto" );\n' >> __setup_extension__; \
fi
### Scribunto
### chameleon
ARG CHAMELEON_VERSION
RUN if [ ! -z "${CHAMELEON_VERSION}" ]; then \
composer-require.sh mediawiki/chameleon-skin ${CHAMELEON_VERSION} && \
echo "wfLoadExtension( 'Bootstrap' );\n" \
"wfLoadSkin( 'chameleon' );\n" \
"\$wgDefaultSkin='chameleon';\n" \ >> __setup_extension__; \
fi
### chameleon
RUN composer update
COPY . /var/www/html/extensions/$EXTENSION
RUN if [ ! -z "${SMW_VERSION}" ] || [ "${EXTENSION}" = "SemanticMediaWiki" ]; then \
chown -R www-data:www-data /var/www/html/extensions/SemanticMediaWiki/; \
fi
ARG OS_PACKAGES
RUN if [ ! -z "${OS_PACKAGES}" ] ; then apt-get update && apt-get install -y $OS_PACKAGES ; fi
ARG PHP_EXTENSIONS
RUN if [ ! -z "${PHP_EXTENSIONS}" ] ; then docker-php-ext-install $PHP_EXTENSIONS ; fi
ARG COMPOSER_EXT
RUN if [ ! -z "${COMPOSER_EXT}" ] ; then cd extensions/$EXTENSION && composer update ; fi
ARG NODE_JS
RUN if [ ! -z "${NODE_JS}" ] ; then cd extensions/$EXTENSION && npm install ; fi
# special handling for testing SMW itself
RUN if [ "${EXTENSION}" = "SemanticMediaWiki" ]; then \
COMPOSER=composer.local.json composer require --no-update --working-dir ${MW_INSTALL_PATH} mediawiki/semantic-media-wiki @dev && \
COMPOSER=composer.local.json composer config repositories.semantic-media-wiki '{"type": "path", "url": "extensions/SemanticMediaWiki"}' --working-dir ${MW_INSTALL_PATH} && \
composer update --working-dir ${MW_INSTALL_PATH}; \
fi
RUN echo \
"wfLoadExtension( '$EXTENSION' );\n" \
>> __setup_extension__
COPY *__setup_extension__ setup_extension
RUN if [ -f setup_extension ]; then \
cat setup_extension >> __setup_extension__; \
fi