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

Change subject: Add experimental npm-node-6-docker job
......................................................................


Add experimental npm-node-6-docker job

Basically runs "npm install && npm test". This image explicitly
does not include "chromium" for now - likely a second image will
be used for that.

We also need to set NPM_CONFIG_CACHE explicitly to point to /cache.

Change-Id: I36bc6ab6cd3a7296ff3c1328089365ee91488e45
---
A dockerfiles/npm-test/Dockerfile
A dockerfiles/npm-test/example-run.sh
A dockerfiles/npm-test/run.sh
M dockerfiles/npm/Dockerfile
M jjb/job-templates.yaml
M zuul/layout.yaml
6 files changed, 67 insertions(+), 0 deletions(-)

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



diff --git a/dockerfiles/npm-test/Dockerfile b/dockerfiles/npm-test/Dockerfile
new file mode 100644
index 0000000..c2e3cc3
--- /dev/null
+++ b/dockerfiles/npm-test/Dockerfile
@@ -0,0 +1,5 @@
+FROM wmfreleng/npm:latest
+
+USER nobody
+COPY run.sh /run.sh
+ENTRYPOINT /bin/bash /run.sh
diff --git a/dockerfiles/npm-test/example-run.sh 
b/dockerfiles/npm-test/example-run.sh
new file mode 100644
index 0000000..8c86277
--- /dev/null
+++ b/dockerfiles/npm-test/example-run.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+mkdir -m 777 -p log
+mkdir -m 777 -p src
+mkdir -m 777 -p cache
+cd src
+git init
+git fetch --quiet --depth 1 
"https://gerrit.wikimedia.org/r/mediawiki/extensions/Flow"; 
"refs/changes/93/382793/1"
+git checkout FETCH_HEAD
+cd ..
+
+docker run \
+    --rm --tty \
+    --volume /"$(pwd)"/log://var/lib/jenkins/log \
+    --volume /"$(pwd)"/cache://cache \
+    --volume /"$(pwd)"/src://src \
+     wmfreleng/npm-test:latest
+rm -rf src
+rm -rf log
+rm -rf cache
diff --git a/dockerfiles/npm-test/run.sh b/dockerfiles/npm-test/run.sh
new file mode 100644
index 0000000..cc315ba
--- /dev/null
+++ b/dockerfiles/npm-test/run.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+umask 002
+
+set -euxo pipefail
+
+cd /src
+
+node --version
+npm --version
+rm -rf node_modules
+npm install
+npm test
diff --git a/dockerfiles/npm/Dockerfile b/dockerfiles/npm/Dockerfile
index 2803c5e..6c116e6 100644
--- a/dockerfiles/npm/Dockerfile
+++ b/dockerfiles/npm/Dockerfile
@@ -9,7 +9,14 @@
 # DO NOT CHANGE VERSION WITHOUT INVOLVING Krinkle OR hashar
 RUN npm install -g [email protected]
 
+# If no volume is mounted, make sure /cache exists
+RUN install --directory /cache --owner nobody
+
 USER nobody
 
+# See <https://docs.npmjs.com/misc/config#environment-variables>
+# and <https://docs.npmjs.com/cli/cache>
+ENV NPM_CONFIG_CACHE=/cache
+
 ENTRYPOINT ["npm"]
 CMD ["--help"]
diff --git a/jjb/job-templates.yaml b/jjb/job-templates.yaml
index 424a298..642487c 100644
--- a/jjb/job-templates.yaml
+++ b/jjb/job-templates.yaml
@@ -161,6 +161,24 @@
      - archive-log-allow-empty
      - castor-save
 
+- job: &job_npm-node-6-docker
+    name: 'npm-node-6-docker'
+    node: DebianJessieDocker
+    concurrent: true
+    triggers:
+     - zuul
+    builders:
+     - docker-src-dir
+     - docker-log-dir
+     - docker-cache-dir
+     - docker-ci-src-setup-simple
+     - docker-run-with-log-cache-src:
+        image: 'wmfreleng/npm-test:v2017.10.28.21.15'
+        logdir: '/log'
+    publishers:
+     - archive-log-allow-empty
+
+
 # A very specific job for MobileFrontend which uses a JavaScript test suite
 # which requires mediawiki/core.
 - job-template:
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 1e53956..2ab5cc2 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -1214,12 +1214,16 @@
     gate-and-submit: &npm-gate-and-submit
       - npm-node-6-jessie
     gate-and-submit-swat: *npm-gate-and-submit
+    experimental:
+      - npm-node-6-docker
 
   - name: mwgate-npm
     test:
       - mwgate-npm-node-6-jessie
     gate-and-submit:
       - mwgate-npm-node-6-jessie
+    experimental:
+      - npm-node-6-docker
 
   - name: rake
     test:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I36bc6ab6cd3a7296ff3c1328089365ee91488e45
Gerrit-PatchSet: 4
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to