mirror of
https://git.sindominio.net/estibadores/wordpress.git
synced 2024-11-21 18:21:07 +01:00
Add: Language Config on Build
This commit is contained in:
parent
69aa02fcdc
commit
365821fda0
41
Dockerfile
41
Dockerfile
@ -28,9 +28,9 @@ ADD wp-config.php /app/
|
|||||||
ADD themes /app/
|
ADD themes /app/
|
||||||
RUN cd wp-content/themes && \
|
RUN cd wp-content/themes && \
|
||||||
for theme in `cat /app/themes`; do \
|
for theme in `cat /app/themes`; do \
|
||||||
DOWNLOAD_URL=`curl "https://api.wordpress.org/themes/info/1.1/?action=theme_information&request\[slug\]=$theme" |jq -r '.download_link'` && \
|
DOWNLOAD_URL=`curl -s "https://api.wordpress.org/themes/info/1.1/?action=theme_information&request\[slug\]=$theme" |jq -r '.download_link'` && \
|
||||||
wget -O theme.zip $DOWNLOAD_URL && \
|
wget -q -O theme.zip $DOWNLOAD_URL && \
|
||||||
unzip theme.zip && \
|
unzip -q theme.zip && \
|
||||||
rm theme.zip; \
|
rm theme.zip; \
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -38,12 +38,41 @@ RUN cd wp-content/themes && \
|
|||||||
ADD plugins /app/
|
ADD plugins /app/
|
||||||
RUN cd wp-content/plugins && \
|
RUN cd wp-content/plugins && \
|
||||||
for plugin in `cat /app/plugins`; do \
|
for plugin in `cat /app/plugins`; do \
|
||||||
DOWNLOAD_URL=`curl "https://api.wordpress.org/plugins/info/1.0/$plugin.json" |jq -r '.download_link'` && \
|
DOWNLOAD_URL=`curl -s "https://api.wordpress.org/plugins/info/1.0/$plugin.json" |jq -r '.download_link'` && \
|
||||||
wget -O plugin.zip $DOWNLOAD_URL && \
|
wget -q -O plugin.zip $DOWNLOAD_URL && \
|
||||||
unzip plugin.zip && \
|
unzip -q plugin.zip && \
|
||||||
rm plugin.zip; \
|
rm plugin.zip; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# install languages (core, plugins, themes)
|
||||||
|
ADD languages /app/
|
||||||
|
RUN mkdir -p wp-content/languages wp-content/languages/plugins wp-content/languages/themes && \
|
||||||
|
WP_VERSION=$(wp --allow-root core version) && \
|
||||||
|
for language in `cat /app/languages`; do \
|
||||||
|
cd /app/wp-content/languages && \
|
||||||
|
echo "Install Language Files $language" && \
|
||||||
|
DOWNLOAD_URL=`curl -s "https://api.wordpress.org/translations/core/1.0/?version=$WP_VERSION" | jq -r '.translations[] | select(.language=="'$language'").package '` && \
|
||||||
|
[ -z $DOWNLOAD_URL ] && echo "Download language file for $language not exist" && \
|
||||||
|
[ -z $DOWNLOAD_URL ] || wget -q -O language.zip $DOWNLOAD_URL && \
|
||||||
|
[ -f language.zip ] && unzip -q language.zip && \
|
||||||
|
[ -f language.zip ] && rm language.zip && \
|
||||||
|
cd plugins && \
|
||||||
|
for plugin in `cat /app/plugins`; do \
|
||||||
|
DOWNLOAD_URL=`curl -s "https://api.wordpress.org/translations/plugins/1.0/?slug=$plugin" | jq -r '.translations[] | select(.language=="'$language'").package '` && \
|
||||||
|
[ -z $DOWNLOAD_URL ] && echo "Download language file for $plugin : $language not exist" && \
|
||||||
|
[ -z $DOWNLOAD_URL ] || wget -q -O language.zip $DOWNLOAD_URL && \
|
||||||
|
[ -z $DOWNLOAD_URL ] || unzip -q language.zip && \
|
||||||
|
[ -z $DOWNLOAD_URL ] || rm language.zip; \
|
||||||
|
done && \
|
||||||
|
cd ../themes && \
|
||||||
|
for theme in `cat /app/themes`; do \
|
||||||
|
DOWNLOAD_URL=`curl -s "https://api.wordpress.org/translations/themes/1.0/?slug=$theme" | jq -r '.translations[] | select(.language=="'$language'").package '` && \
|
||||||
|
[ -z $DOWNLOAD_URL ] && echo "Download language file for $theme : $language not exist" && \
|
||||||
|
[ -z $DOWNLOAD_URL ] || wget -q -O language.zip $DOWNLOAD_URL && \
|
||||||
|
[ -z $DOWNLOAD_URL ] || unzip -q language.zip && \
|
||||||
|
[ -z $DOWNLOAD_URL ] || rm language.zip; \
|
||||||
|
done; \
|
||||||
|
done
|
||||||
|
|
||||||
VOLUME /app/wp-content/uploads
|
VOLUME /app/wp-content/uploads
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user