jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/388448 )

Change subject: Convert operations-puppet to docker-pkg
......................................................................


Convert operations-puppet to docker-pkg

Change-Id: Ic624b9351565b5256cb8a250e8e6d404e5082879
---
D dockerfiles/operations-puppet/Dockerfile
A dockerfiles/operations-puppet/Dockerfile.template
M dockerfiles/operations-puppet/bundle-config
A dockerfiles/operations-puppet/changelog
A dockerfiles/operations-puppet/control
M dockerfiles/operations-puppet/example-run.sh
M dockerfiles/operations-puppet/run.sh
7 files changed, 35 insertions(+), 80 deletions(-)

Approvals:
  Thcipriani: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/dockerfiles/operations-puppet/Dockerfile 
b/dockerfiles/operations-puppet/Dockerfile
deleted file mode 100644
index d43bdcc..0000000
--- a/dockerfiles/operations-puppet/Dockerfile
+++ /dev/null
@@ -1,75 +0,0 @@
-FROM docker-registry.wikimedia.org/wikimedia-jessie:latest as builder
-
-ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
-
-RUN apt-get update && \
-    DEBIAN_FRONTEND=noninteractive apt-get install --yes \
-        ca-certificates \
-        git \
-    && \
-    mkdir -p /tmp/cache && \
-    git clone https://gerrit.wikimedia.org/r/operations/puppet 
/tmp/cache/puppet
-
-RUN apt-get update && \
-    DEBIAN_FRONTEND=noninteractive apt-get install --yes \
-        build-essential \
-        bundler \
-        libmysqlclient-dev \
-        locales \
-        python-dev \
-        python-pip \
-        rubygems-integration \
-        rake \
-        ruby \
-        ruby-dev \
-        && \
-        pip install pip==8.1.2 && \
-        pip install tox==1.9.2 setuptools
-
-COPY .cache-buster-operations-puppet /.cache-buster-operations-puppet
-
-# Make all kinds of artifacts
-RUN cd /tmp/cache/puppet && \
-    git remote update && \
-    git prune origin && \
-    git reset --hard $(cut -f1 /.cache-buster-operations-puppet) && \
-    git clean -xqdf && \
-    git tag -f 'docker-head' && \
-    git gc --prune=now && \
-    bundle install --clean --path="/tmp/cache/bundle" && \
-    TOX_TESTENV_PASSENV=PY_COLORS PY_COLORS=1 tox -v --notest && \
-    mv .tox /tmp/cache/tox
-
-FROM wmfreleng/ci-jessie:latest
-
-ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
-
-RUN apt-get update && \
-    DEBIAN_FRONTEND=noninteractive apt-get install --yes \
-        build-essential \
-        bundler \
-        python-dev \
-        python-pip \
-        rubygems-integration \
-        rake \
-        ruby \
-        ruby-dev && \
-        apt-get clean && rm -rf /var/lib/apt/lists/*  && \
-        pip install pip==8.1.2 && \
-        pip install tox==1.9.2 setuptools
-
-COPY --from=builder /tmp/cache /srv/workspace/.cache
-COPY bundle-config /srv/workspace/.cache/bundle-config
-
-RUN chown -R nobody /srv/workspace/.cache && \
-          mkdir -p /tmp/cache && \
-          mv /srv/workspace/.cache/puppet /tmp/cache/puppet && \
-          mkdir -p /tmp/cache/puppet/.bundle && \
-          mv /srv/workspace/.cache/bundle-config 
/tmp/cache/puppet/.bundle/config && \
-          mv /srv/workspace/.cache/tox /tmp/cache/puppet/.tox
-
-USER nobody
-WORKDIR /srv/workspace
-ENTRYPOINT /bin/bash /run.sh
-
-COPY run.sh /run.sh
diff --git a/dockerfiles/operations-puppet/Dockerfile.template 
b/dockerfiles/operations-puppet/Dockerfile.template
new file mode 100644
index 0000000..ae1d996
--- /dev/null
+++ b/dockerfiles/operations-puppet/Dockerfile.template
@@ -0,0 +1,26 @@
+FROM {{ "ci-jessie" | image_tag }}
+
+ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
+
+ENV PUPPET_DIR='/srv/workspace/puppet'
+
+{% set pkgs_to_install = """build-essential bundler python-dev \
+    python-pip rubygems-integration rake ruby ruby-dev ca-certificates 
libmysqlclient-dev""" %}
+
+RUN {{ pkgs_to_install | apt_install }} \
+    && pip install pip==8.1.2 \
+    && pip install tox==1.9.2 setuptools \
+    && mkdir -p /srv/workspace \
+    && git clone https://gerrit.wikimedia.org/r/operations/puppet 
"${PUPPET_DIR}" \
+    && cd "${PUPPET_DIR}" \
+    && git tag -f 'docker-head' && git gc --prune=now \
+    && TOX_TESTENV_PASSENV=PY_COLORS PY_COLORS=1 tox -v --notest \
+    && bundle install --clean --path="${PUPPET_DIR}/.bundle" \
+    && chown -R nobody "${PUPPET_DIR}"
+
+USER nobody
+WORKDIR /srv/workspace
+ENTRYPOINT /bin/bash /run.sh
+
+COPY bundle-config "${PUPPET_DIR}/.bundle/bundle-config"
+COPY run.sh /run.sh
diff --git a/dockerfiles/operations-puppet/bundle-config 
b/dockerfiles/operations-puppet/bundle-config
index be4ea90..79b71ce 100644
--- a/dockerfiles/operations-puppet/bundle-config
+++ b/dockerfiles/operations-puppet/bundle-config
@@ -1,3 +1,2 @@
-BUNDLE_PATH: "/srv/workspace/.cache/bundle"
 BUNDLE_CLEAN: true
 BUNDLE_DISABLE_SHARED_GEMS: '1'
diff --git a/dockerfiles/operations-puppet/changelog 
b/dockerfiles/operations-puppet/changelog
new file mode 100644
index 0000000..5cfa177
--- /dev/null
+++ b/dockerfiles/operations-puppet/changelog
@@ -0,0 +1,5 @@
+operations-puppet (0.1.0) wikimedia; urgency=medium
+
+  * Initial conversion to docker-pkg
+
+ -- Giuseppe Lavagetto <[email protected]>  Mon, 23 Oct 2017 10:18:11 
+0200
diff --git a/dockerfiles/operations-puppet/control 
b/dockerfiles/operations-puppet/control
new file mode 100644
index 0000000..854813c
--- /dev/null
+++ b/dockerfiles/operations-puppet/control
@@ -0,0 +1,3 @@
+Package: operations-puppet
+Description: Image for running CI tests on the puppet repo
+Maintainer: Antoine Musso <[email protected]> 
diff --git a/dockerfiles/operations-puppet/example-run.sh 
b/dockerfiles/operations-puppet/example-run.sh
index 6097ea0..dfc5cf2 100644
--- a/dockerfiles/operations-puppet/example-run.sh
+++ b/dockerfiles/operations-puppet/example-run.sh
@@ -8,4 +8,4 @@
     --env ZUUL_COMMIT=72d31ffb0fa612482d268b6f5484785842cd0fda \
     --env ZUUL_REF=refs/changes/49/374349/2 \
     --volume /$(pwd)/log://srv/workspace/log \
-     wmfreleng/operations-puppet:latest
+     wmfreleng/operations-puppet:0.1.0
diff --git a/dockerfiles/operations-puppet/run.sh 
b/dockerfiles/operations-puppet/run.sh
index 516abc8..14d8ce0 100755
--- a/dockerfiles/operations-puppet/run.sh
+++ b/dockerfiles/operations-puppet/run.sh
@@ -4,9 +4,6 @@
 
 RAKE_TARGET=${RAKE_TARGET:-test}
 
-# Has to be in the same directory as in Dockerfile.build because of tox caching
-PUPPET_DIR="/tmp/cache/puppet"
-
 LOG_DIR="/srv/workspace/log"
 export LOG_DIR
 

-- 
To view, visit https://gerrit.wikimedia.org/r/388448
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic624b9351565b5256cb8a250e8e6d404e5082879
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: Thcipriani <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to