Hashar has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/355241 )
Change subject: Reorder commands in Dockerfile
..
Reorder commands in Dockerfile
mediawiki repos are no more added to the container, instead one should
clone them on the host then bind mount read-only. Updated README.md for
instructions.
Install the CI utilities composer and slave-scripts as shallow
repositories. We don't need the history. Ideally we could even just use
a snapshot with `git archive`, but gerrit over https does not support
it. Just strip their .git directories for now.
Change-Id: I928b4c02e4484b31cf8f83e24065dac018ad7e7d
---
M .dockerignore
M .gitignore
M Dockerfile
M README.md
4 files changed, 35 insertions(+), 16 deletions(-)
Approvals:
jenkins-bot: Verified
Objections:
Hashar: Do not submit
diff --git a/.dockerignore b/.dockerignore
index 43ff9b5..abf352d 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,7 +1,8 @@
# vim
**/*.swp
-# Local cache when mounting with -v`pwd`/cache:cache
+# Local caches bind mounted in the container
cache
+ref
# Dev related
.git
.tox
diff --git a/.gitignore b/.gitignore
index bfbeb7a..10354db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
/.coverage
/quibble.egg-info/
+/cache/
/cover/
+/ref/
/.tox
*.pyc
/tests/.tmp
diff --git a/Dockerfile b/Dockerfile
index 9a7151c..d37d761 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,23 +1,25 @@
FROM debian:jessie
-RUN apt-get update && apt-get install -y \
+# Git repositories mirroring to speed up git clone in CI
+RUN apt-get update && apt-get install -y git
+
+# CI utilities
+RUN git clone --depth=1
"https://gerrit.wikimedia.org/r/p/integration/composer";
"/srv/deployment/integration/composer" && \
+rm -fR /srv/deployment/integration/composer/.git && \
+git clone --depth=1 "https://gerrit.wikimedia.org/r/p/integration/jenkins";
"/srv/deployment/integration/slave-scripts" && \
+rm -fR /srv/deployment/integration/slave-scripts/.git && \
+ ln -s "/srv/deployment/integration/composer/vendor/bin/composer"
"/usr/local/bin/composer"
+
+# Mediawiki related dependencies
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server php5
php5-mysql php5-gd php5-curl djvulibre-bin nodejs-legacy
+
+# Quibble dependencies
+RUN apt-get install -y \
+python3-pip \
+python3-paramiko \
python3 \
python3-dev \
python-tox
-
-RUN apt-get install -y python3-pip git python3-paramiko
-RUN mkdir -p /srv/git/mediawiki && \
-mkdir -p /srv/deployment/integration && \
-git clone --bare "https://gerrit.wikimedia.org/r/p/mediawiki/core";
"/srv/git/mediawiki/core.git" && \
-git clone --bare "https://gerrit.wikimedia.org/r/p/mediawiki/vendor";
"/srv/git/mediawiki/vendor.git" && \
-git clone "https://gerrit.wikimedia.org/r/p/integration/jenkins";
"/srv/deployment/integration/slave-scripts"
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server php5
php5-mysql php5-gd php5-curl djvulibre-bin nodejs-legacy && \
-/usr/sbin/service mysql start
-
-RUN git clone "https://gerrit.wikimedia.org/r/p/integration/composer";
"/srv/deployment/integration/composer" && \
- ln -s "/srv/deployment/integration/composer/vendor/bin/composer"
"/usr/local/bin/composer"
-
# Some of Zuul dependencies. Would be better done by install the zuul.deb
package from apt.wikimedia.org
RUN apt-get install -y \
python3-pbr \
diff --git a/README.md b/README.md
index ba7b9e2..a2a958a 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,20 @@
service mysql start
ZUUL_URL=https://gerrit.wikimedia.org/r/p ZUUL_BRANCH=master
ZUUL_REF=master quibble --packages-source vendor --workspace /workspace
+CACHING
+---
+
+To avoid cloning MediaWiki over the network, you should initialize local bare
+repositories to be used as cache to copy from:
+
+ mkdir -p ref/mediawiki
+ git clone --bare mediawiki/core ref/mediawiki/core.git
+ git clone --bare mediawiki/vendor ref/mediawiki/vendor.git
+
+Then bindmount it READ-ONLY as /srv/git:
+
+ docker run -it --rm -v `pwd`/ref:/srv/git:ro quibble bash
+
TESTING
---
--
To view, visit https://gerrit.wikimedia.org/r/355241
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I928b4c02e4484b31cf8f83e24065dac018ad7e7d
Gerrit-PatchSet: 2
Gerrit-Project: integration/quibble
Gerrit-Branch: master
Gerrit-Owner: Hashar
Gerrit-Reviewer: Hashar
Gerrit-Reviewer: Paladox
Gerrit-Reviewer: Thcipriani
Gerrit-Reviewer: jenkins-bot <>
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits