Repository: couchdb-ci
Updated Branches:
  refs/heads/master 5f817d76a -> c468e27a8


http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/centos-6-erlang-18.3
----------------------------------------------------------------------
diff --git a/dockerfiles/centos-6-erlang-18.3 b/dockerfiles/centos-6-erlang-18.3
deleted file mode 100644
index 2dcd2ab..0000000
--- a/dockerfiles/centos-6-erlang-18.3
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/centos-6-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Erlang 18.3
-RUN ansible-playbook centos-6-erlang-18.3.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/centos-6-erlang-default
----------------------------------------------------------------------
diff --git a/dockerfiles/centos-6-erlang-default 
b/dockerfiles/centos-6-erlang-default
deleted file mode 100644
index 8b12634..0000000
--- a/dockerfiles/centos-6-erlang-default
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/centos-6-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with CentOS' default Erlang
-RUN ansible-playbook centos-6-erlang-default.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/centos-7
----------------------------------------------------------------------
diff --git a/dockerfiles/centos-7 b/dockerfiles/centos-7
new file mode 100644
index 0000000..b8fcffc
--- /dev/null
+++ b/dockerfiles/centos-7
@@ -0,0 +1,57 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+
+# NOTE: These are intended to be built using the arguments as
+# described in ../build.sh. See that script for more details.
+
+FROM centos:7
+
+# Choose whether to install SpiderMonkey 1.8.5, default yes
+ARG js=js
+# Choose whether to install Erlang, default yes
+ARG erlang=erlang
+# Select version of Node and Erlang to install
+ARG erlangversion=19.3.6
+ARG nodeversion=8
+
+# Create Jenkins user and group
+RUN groupadd --gid 12036 jenkins; \
+  useradd --uid 10025 --gid jenkins --create-home jenkins
+
+# Copy couchdb-ci repo into root's home directory
+ADD --chown=root:root bin /root/couchdb-ci/bin/
+ADD --chown=root:root files /root/couchdb-ci/files/
+
+# Jenkins builds in /usr/src/couchdb.
+RUN mkdir -p /usr/src/couchdb; \
+  chown -R jenkins:jenkins /usr/src/couchdb
+
+# Add /usr/local/lib to global LD_LIBRARY_PATH for CentOS
+RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf
+
+# Install all dependencies, and optionally SM 1.8.5
+# This allows us to use the same Dockerfile for building SM
+RUN ERLANGVERSION=$erlangversion \
+  NODEVERSION=$nodeversion \
+  /root/couchdb-ci/bin/install-dependencies.sh $js $erlang
+
+# Allow Jenkins to sudo
+RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins
+
+USER jenkins
+
+# overwrite this with 'CMD []' in a dependent Dockerfile
+CMD ["/bin/bash"]

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/centos-7-base
----------------------------------------------------------------------
diff --git a/dockerfiles/centos-7-base b/dockerfiles/centos-7-base
deleted file mode 100644
index 17e23c4..0000000
--- a/dockerfiles/centos-7-base
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-# Base Image: Plain Vanilla CentOS with Ansible installed
-FROM williamyeh/ansible:centos7-onbuild
-
-# Add ansible directory and cd to it
-ADD ./ansible /ansible
-WORKDIR /ansible
-
-# Install Ansible roles
-RUN ansible-galaxy install geerlingguy.repo-epel
-
-# Run Ansible to provision CentOS base container
-RUN ansible-playbook centos-7-base.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/centos-7-erlang-18.3
----------------------------------------------------------------------
diff --git a/dockerfiles/centos-7-erlang-18.3 b/dockerfiles/centos-7-erlang-18.3
deleted file mode 100644
index 3729279..0000000
--- a/dockerfiles/centos-7-erlang-18.3
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/centos-7-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Erlang 18.3
-RUN ansible-playbook centos-7-erlang-18.3.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/centos-7-erlang-default
----------------------------------------------------------------------
diff --git a/dockerfiles/centos-7-erlang-default 
b/dockerfiles/centos-7-erlang-default
deleted file mode 100644
index 8071548..0000000
--- a/dockerfiles/centos-7-erlang-default
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/centos-7-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with CentOS' default Erlang
-RUN ansible-playbook centos-7-erlang-default.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/debian-8-base
----------------------------------------------------------------------
diff --git a/dockerfiles/debian-8-base b/dockerfiles/debian-8-base
deleted file mode 100644
index b479be4..0000000
--- a/dockerfiles/debian-8-base
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-# Base Image: Plain Vanilla Debian with Ansible installed
-FROM williamyeh/ansible:debian8-onbuild
-
-# Add ansible directory and cd to it
-ADD ./ansible /ansible
-WORKDIR /ansible
-
-# Install Ansible roles
-RUN ansible-galaxy install nodesource.node
-
-# Run Ansible to provision Debian base container
-RUN ansible-playbook debian-8-base.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/debian-8-erlang-18.3
----------------------------------------------------------------------
diff --git a/dockerfiles/debian-8-erlang-18.3 b/dockerfiles/debian-8-erlang-18.3
deleted file mode 100644
index 445eb3d..0000000
--- a/dockerfiles/debian-8-erlang-18.3
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/debian-8-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Erlang 18.3
-RUN ansible-playbook debian-8-erlang-18.3.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/debian-8-erlang-default
----------------------------------------------------------------------
diff --git a/dockerfiles/debian-8-erlang-default 
b/dockerfiles/debian-8-erlang-default
deleted file mode 100644
index d547b70..0000000
--- a/dockerfiles/debian-8-erlang-default
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/debian-8-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Debian's default Erlang
-RUN ansible-playbook debian-8-erlang-default.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/debian-9-base
----------------------------------------------------------------------
diff --git a/dockerfiles/debian-9-base b/dockerfiles/debian-9-base
deleted file mode 100644
index 8d86dbf..0000000
--- a/dockerfiles/debian-9-base
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-# Base Image: Plain Vanilla Debian with Ansible installed
-FROM williamyeh/ansible:debian9-onbuild
-
-# Add ansible directory and cd to it
-ADD ./ansible /ansible
-WORKDIR /ansible
-
-# Install Ansible roles
-RUN ansible-galaxy install nodesource.node
-
-# Run Ansible to provision Debian base container
-RUN ansible-playbook debian-9-base.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/debian-9-erlang-18.3
----------------------------------------------------------------------
diff --git a/dockerfiles/debian-9-erlang-18.3 b/dockerfiles/debian-9-erlang-18.3
deleted file mode 100644
index 90cdc87..0000000
--- a/dockerfiles/debian-9-erlang-18.3
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/debian-9-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Erlang 18.3
-RUN ansible-playbook debian-9-erlang-18.3.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/debian-9-erlang-default
----------------------------------------------------------------------
diff --git a/dockerfiles/debian-9-erlang-default 
b/dockerfiles/debian-9-erlang-default
deleted file mode 100644
index 1ac2140..0000000
--- a/dockerfiles/debian-9-erlang-default
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/debian-9-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Debian's default Erlang
-RUN ansible-playbook debian-9-erlang-default.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/debian-jessie
----------------------------------------------------------------------
diff --git a/dockerfiles/debian-jessie b/dockerfiles/debian-jessie
new file mode 100644
index 0000000..21d153a
--- /dev/null
+++ b/dockerfiles/debian-jessie
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+
+# NOTE: These are intended to be built using the arguments as
+# described in ../build.sh. See that script for more details.
+
+FROM debian:jessie
+
+# Choose whether to install SpiderMonkey 1.8.5, default yes
+ARG js=js
+# Choose whether to install Erlang, default yes
+ARG erlang=erlang
+# Select version of Node and Erlang to install
+ARG erlangversion=19.3.6
+ARG nodeversion=8
+
+# Create Jenkins user and group
+RUN groupadd --gid 12036 jenkins; \
+  useradd --uid 10025 --gid jenkins --create-home jenkins
+
+# Copy couchdb-ci repo into root's home directory
+ADD --chown=root:root bin /root/couchdb-ci/bin/
+ADD --chown=root:root files /root/couchdb-ci/files/
+
+# Jenkins builds in /usr/src/couchdb.
+RUN mkdir -p /usr/src/couchdb; \
+  chown -R jenkins:jenkins /usr/src/couchdb
+
+# Install all dependencies, and optionally SM 1.8.5
+# This allows us to use the same Dockerfile for building SM
+RUN ERLANGVERSION=$erlangversion \
+  NODEVERSION=$nodeversion \
+  /root/couchdb-ci/bin/install-dependencies.sh $js $erlang
+
+# Allow Jenkins to sudo
+RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins
+
+USER jenkins
+
+# overwrite this with 'CMD []' in a dependent Dockerfile
+CMD ["/bin/bash"]

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/debian-stretch
----------------------------------------------------------------------
diff --git a/dockerfiles/debian-stretch b/dockerfiles/debian-stretch
new file mode 100644
index 0000000..ff111df
--- /dev/null
+++ b/dockerfiles/debian-stretch
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+
+# NOTE: These are intended to be built using the arguments as
+# described in ../build.sh. See that script for more details.
+
+FROM debian:stretch
+
+# Choose whether to install SpiderMonkey 1.8.5, default yes
+ARG js=js
+# Choose whether to install Erlang, default yes
+ARG erlang=erlang
+# Select version of Node and Erlang to install
+ARG erlangversion=19.3.6
+ARG nodeversion=8
+
+# Create Jenkins user and group
+RUN groupadd --gid 12036 jenkins; \
+  useradd --uid 10025 --gid jenkins --create-home jenkins
+
+# Copy couchdb-ci repo into root's home directory
+ADD --chown=root:root bin /root/couchdb-ci/bin/
+ADD --chown=root:root files /root/couchdb-ci/files/
+
+# Jenkins builds in /usr/src/couchdb.
+RUN mkdir -p /usr/src/couchdb; \
+  chown -R jenkins:jenkins /usr/src/couchdb
+
+# Install all dependencies, and optionally SM 1.8.5
+# This allows us to use the same Dockerfile for building SM
+RUN ERLANGVERSION=$erlangversion \
+  NODEVERSION=$nodeversion \
+  /root/couchdb-ci/bin/install-dependencies.sh $js $erlang
+
+# Allow Jenkins to sudo
+RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins
+
+USER jenkins
+
+# overwrite this with 'CMD []' in a dependent Dockerfile
+CMD ["/bin/bash"]

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-12.04-base
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-12.04-base b/dockerfiles/ubuntu-12.04-base
deleted file mode 100644
index c158fea..0000000
--- a/dockerfiles/ubuntu-12.04-base
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-# Base Image: Plain Vanilla Ubuntu 12.04 with Ansible installed
-FROM williamyeh/ansible:ubuntu12.04-onbuild
-
-# Add ansible directory and cd to it
-ADD ./ansible /ansible
-WORKDIR /ansible
-
-# Install Ansible roles
-RUN ansible-galaxy install nodesource.node
-
-# Run Ansible to provision Ubuntu base container
-RUN ansible-playbook ubuntu-12.04-base.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-12.04-erlang-18.3
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-12.04-erlang-18.3 
b/dockerfiles/ubuntu-12.04-erlang-18.3
deleted file mode 100644
index 51d8fc3..0000000
--- a/dockerfiles/ubuntu-12.04-erlang-18.3
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/ubuntu-12.04-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Erlang 18.3
-RUN ansible-playbook ubuntu-12.04-erlang-18.3.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-12.04-erlang-default
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-12.04-erlang-default 
b/dockerfiles/ubuntu-12.04-erlang-default
deleted file mode 100644
index 0c98669..0000000
--- a/dockerfiles/ubuntu-12.04-erlang-default
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/ubuntu-12.04-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Ubuntu's default Erlang
-RUN ansible-playbook ubuntu-12.04-erlang-default.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-14.04-base
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-14.04-base b/dockerfiles/ubuntu-14.04-base
deleted file mode 100644
index 8d5c59b..0000000
--- a/dockerfiles/ubuntu-14.04-base
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-# Base Image: Plain Vanilla Ubuntu 14.04 with Ansible installed
-FROM williamyeh/ansible:ubuntu14.04-onbuild
-
-# Add ansible directory and cd to it
-ADD ./ansible /ansible
-WORKDIR /ansible
-
-# Install Ansible roles
-RUN ansible-galaxy install nodesource.node
-
-# Run Ansible to provision Ubuntu base container
-RUN ansible-playbook ubuntu-14.04-base.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-14.04-erlang-18.3
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-14.04-erlang-18.3 
b/dockerfiles/ubuntu-14.04-erlang-18.3
deleted file mode 100644
index 179f9ce..0000000
--- a/dockerfiles/ubuntu-14.04-erlang-18.3
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/ubuntu-14.04-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Erlang 18.3
-RUN ansible-playbook ubuntu-14.04-erlang-18.3.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-14.04-erlang-default
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-14.04-erlang-default 
b/dockerfiles/ubuntu-14.04-erlang-default
deleted file mode 100644
index 507cc38..0000000
--- a/dockerfiles/ubuntu-14.04-erlang-default
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/ubuntu-14.04-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Ubuntu's default Erlang
-RUN ansible-playbook ubuntu-14.04-erlang-default.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-16.04-base
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-16.04-base b/dockerfiles/ubuntu-16.04-base
deleted file mode 100644
index 1313bc4..0000000
--- a/dockerfiles/ubuntu-16.04-base
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-# Base Image: Plain Vanilla Ubuntu 14.04 with Ansible installed
-FROM williamyeh/ansible:ubuntu16.04-onbuild
-
-# Add ansible directory and cd to it
-ADD ./ansible /ansible
-WORKDIR /ansible
-
-# Install Ansible roles
-RUN ansible-galaxy install nodesource.node
-
-# Run Ansible to provision Ubuntu base container
-RUN ansible-playbook ubuntu-16.04-base.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-16.04-erlang-18.3
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-16.04-erlang-18.3 
b/dockerfiles/ubuntu-16.04-erlang-18.3
deleted file mode 100644
index fcf6b08..0000000
--- a/dockerfiles/ubuntu-16.04-erlang-18.3
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/ubuntu-16.04-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Erlang 18.3
-RUN ansible-playbook ubuntu-16.04-erlang-18.3.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-16.04-erlang-default
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-16.04-erlang-default 
b/dockerfiles/ubuntu-16.04-erlang-default
deleted file mode 100644
index 85335a8..0000000
--- a/dockerfiles/ubuntu-16.04-erlang-default
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing,
-#   software distributed under the License is distributed on an
-#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied.  See the License for the
-#   specific language governing permissions and limitations
-
-# NOTE: All docker files need to be run from ../../, that is
-# docker build -f /docker/<container>/Dockerfile
-
-FROM couchdbdev/ubuntu-16.04-base:latest
-
-# Re-add ansible directory to pick up latest changes
-# This avoids having to cascade rebuild all images when changing
-# a role that only affects a child container
-ADD ./ansible /ansible
-
-# Run Ansible to provision container with Ubuntu's default Erlang
-RUN ansible-playbook ubuntu-16.04-erlang-default.yml \
-  --connection=local \
-  --inventory-file=./inventory/couchdb-ci-worker
-
-USER build

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-bionic
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-bionic b/dockerfiles/ubuntu-bionic
new file mode 100644
index 0000000..c82418e
--- /dev/null
+++ b/dockerfiles/ubuntu-bionic
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+
+# NOTE: These are intended to be built using the arguments as
+# described in ../build.sh. See that script for more details.
+
+FROM ubuntu:bionic
+
+# Choose whether to install SpiderMonkey 1.8.5, default yes
+ARG js=js
+# Choose whether to install Erlang, default yes
+ARG erlang=erlang
+# Select version of Node and Erlang to install
+ARG erlangversion=19.3.6
+ARG nodeversion=8
+
+# Create Jenkins user and group
+RUN groupadd --gid 12036 jenkins; \
+  useradd --uid 10025 --gid jenkins --create-home jenkins
+
+# Copy couchdb-ci repo into root's home directory
+ADD --chown=root:root bin /root/couchdb-ci/bin/
+ADD --chown=root:root files /root/couchdb-ci/files/
+
+# Jenkins builds in /usr/src/couchdb.
+RUN mkdir -p /usr/src/couchdb; \
+  chown -R jenkins:jenkins /usr/src/couchdb
+
+# Install all dependencies, and optionally SM 1.8.5
+# This allows us to use the same Dockerfile for building SM
+RUN ERLANGVERSION=$erlangversion \
+  NODEVERSION=$nodeversion \
+  /root/couchdb-ci/bin/install-dependencies.sh $js $erlang
+
+# Allow Jenkins to sudo
+RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins
+
+USER jenkins
+
+# overwrite this with 'CMD []' in a dependent Dockerfile
+CMD ["/bin/bash"]

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-trusty
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-trusty b/dockerfiles/ubuntu-trusty
new file mode 100644
index 0000000..4107203
--- /dev/null
+++ b/dockerfiles/ubuntu-trusty
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+
+# NOTE: These are intended to be built using the arguments as
+# described in ../build.sh. See that script for more details.
+
+FROM ubuntu:trusty
+
+# Choose whether to install SpiderMonkey 1.8.5, default yes
+ARG js=js
+# Choose whether to install Erlang, default yes
+ARG erlang=erlang
+# Select version of Node and Erlang to install
+ARG erlangversion=19.3.6
+ARG nodeversion=8
+
+# Create Jenkins user and group
+RUN groupadd --gid 12036 jenkins; \
+  useradd --uid 10025 --gid jenkins --create-home jenkins
+
+# Copy couchdb-ci repo into root's home directory
+ADD --chown=root:root bin /root/couchdb-ci/bin/
+ADD --chown=root:root files /root/couchdb-ci/files/
+
+# Jenkins builds in /usr/src/couchdb.
+RUN mkdir -p /usr/src/couchdb; \
+  chown -R jenkins:jenkins /usr/src/couchdb
+
+# Install all dependencies, and optionally SM 1.8.5
+# This allows us to use the same Dockerfile for building SM
+RUN ERLANGVERSION=$erlangversion \
+  NODEVERSION=$nodeversion \
+  /root/couchdb-ci/bin/install-dependencies.sh $js $erlang
+
+# Allow Jenkins to sudo
+RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins
+
+USER jenkins
+
+# overwrite this with 'CMD []' in a dependent Dockerfile
+CMD ["/bin/bash"]

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/dockerfiles/ubuntu-xenial
----------------------------------------------------------------------
diff --git a/dockerfiles/ubuntu-xenial b/dockerfiles/ubuntu-xenial
new file mode 100644
index 0000000..8661be5
--- /dev/null
+++ b/dockerfiles/ubuntu-xenial
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+
+# NOTE: These are intended to be built using the arguments as
+# described in ../build.sh. See that script for more details.
+
+FROM ubuntu:xenial
+
+# Choose whether to install SpiderMonkey 1.8.5, default yes
+ARG js=js
+# Choose whether to install Erlang, default yes
+ARG erlang=erlang
+# Select version of Node and Erlang to install
+ARG erlangversion=19.3.6
+ARG nodeversion=8
+
+# Create Jenkins user and group
+RUN groupadd --gid 12036 jenkins; \
+  useradd --uid 10025 --gid jenkins --create-home jenkins
+
+# Copy couchdb-ci repo into root's home directory
+ADD --chown=root:root bin /root/couchdb-ci/bin/
+ADD --chown=root:root files /root/couchdb-ci/files/
+
+# Jenkins builds in /usr/src/couchdb.
+RUN mkdir -p /usr/src/couchdb; \
+  chown -R jenkins:jenkins /usr/src/couchdb
+
+# Install all dependencies, and optionally SM 1.8.5
+# This allows us to use the same Dockerfile for building SM
+RUN ERLANGVERSION=$erlangversion \
+  NODEVERSION=$nodeversion \
+  /root/couchdb-ci/bin/install-dependencies.sh $js $erlang
+
+# Allow Jenkins to sudo
+RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins
+
+USER jenkins
+
+# overwrite this with 'CMD []' in a dependent Dockerfile
+CMD ["/bin/bash"]

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/files/debian.profile
----------------------------------------------------------------------
diff --git a/files/debian.profile b/files/debian.profile
new file mode 100644
index 0000000..4a7788c
--- /dev/null
+++ b/files/debian.profile
@@ -0,0 +1,3 @@
+Profile: couchdb/main
+Extends: debian/main
+Disable-Tags: dir-or-file-in-opt, source-is-missing, 
non-etc-file-marked-as-conffile, embedded-library, duplicate-font-file, 
embedded-javascript-library

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/files/ubuntu.profile
----------------------------------------------------------------------
diff --git a/files/ubuntu.profile b/files/ubuntu.profile
new file mode 100644
index 0000000..b4520cb
--- /dev/null
+++ b/files/ubuntu.profile
@@ -0,0 +1,3 @@
+Profile: couchdb/main
+Extends: ubuntu/main
+Disable-Tags: dir-or-file-in-opt, source-is-missing, 
non-etc-file-marked-as-conffile

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/utils/analyze-jenkins-logs/.gitignore
----------------------------------------------------------------------
diff --git a/utils/analyze-jenkins-logs/.gitignore 
b/utils/analyze-jenkins-logs/.gitignore
deleted file mode 100644
index c2658d7..0000000
--- a/utils/analyze-jenkins-logs/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/utils/analyze-jenkins-logs/bin/analyze-jenkins-logs
----------------------------------------------------------------------
diff --git a/utils/analyze-jenkins-logs/bin/analyze-jenkins-logs 
b/utils/analyze-jenkins-logs/bin/analyze-jenkins-logs
deleted file mode 100755
index 229356d..0000000
--- a/utils/analyze-jenkins-logs/bin/analyze-jenkins-logs
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env node
-
-require('..');

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/utils/analyze-jenkins-logs/ci-errors.markdown
----------------------------------------------------------------------
diff --git a/utils/analyze-jenkins-logs/ci-errors.markdown 
b/utils/analyze-jenkins-logs/ci-errors.markdown
deleted file mode 100644
index 5435c2f..0000000
--- a/utils/analyze-jenkins-logs/ci-errors.markdown
+++ /dev/null
@@ -1,154 +0,0 @@
-# Summary
-
-Successes: 38 Failures: 57
-
-
-# Uncategorized Failures
-
-* Number of failures: 6
-
-## Builds
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/18/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/22/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/23/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=centos-7,label=docker/26/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=centos-7,label=docker/18/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=centos-7,label=docker/28/consoleText>
-
-
-# Failures with reason "eunit_replicator"
-
-* Number of failures: 30
-## Regular Expressions
-When one of these regular expression has a match in the build log, I assume 
this build failure falls into this category.
-
-* `/\\*\\*in function couch_replicator_filtered_tests:should_succeed/`
-* 
`/\\*\\*error:\{assertion_failed,\[\{module,couch_replicator_compact_tests\}/`
-
-## Builds
-
-Links to the build logs:
-
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/19/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/21/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/21/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/23/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/23/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=ubuntu-14.04,label=docker/24/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/24/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/16/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/27/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/27/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/27/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/28/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/28/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/28/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=ubuntu-14.04,label=docker/29/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=centos-7,label=docker/29/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/29/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/30/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=centos-7,label=docker/29/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=ubuntu-14.04,label=docker/30/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=centos-7,label=docker/30/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/30/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/30/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=centos-7,label=docker/33/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=centos-7,label=docker/33/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=ubuntu-14.04,label=docker/33/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/33/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/33/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/33/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=centos-7,label=docker/30/consoleText>
-
-
-# Failures with reason "eunit_compression"
-
-* Number of failures: 10
-## Regular Expressions
-When one of these regular expression has a match in the build log, I assume 
this build failure falls into this category.
-
-* `/couchdb_file_compression_tests:110: 
should_compare_compression_methods.*\\*failed\\*/`
-* `/in call from couchdb_file_compression_tests:setup\/0 
\(test\/couchdb_file_compression_tests.erl, line 38\)/`
-
-## Builds
-
-Links to the build logs:
-
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/12/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/12/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/17/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/15/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/20/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/19/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/24/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=ubuntu-14.04,label=docker/26/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/29/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/29/consoleText>
-
-
-# Failures with reason "network"
-
-* Number of failures: 6
-## Regular Expressions
-When one of these regular expression has a match in the build log, I assume 
this build failure falls into this category.
-
-* `/fatal: unable to access 'https:\/\/github.com/`
-* `/fatal: read error: Connection reset by peer/`
-
-## Builds
-
-Links to the build logs:
-
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=debian-8,label=docker/14/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=ubuntu-14.04,label=docker/20/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=centos-7,label=docker/24/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=centos-7,label=docker/24/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=ubuntu-14.04,label=docker/28/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=centos-7,label=docker/28/consoleText>
-
-
-# Failures with reason "docker"
-
-* Number of failures: 3
-## Regular Expressions
-When one of these regular expression has a match in the build log, I assume 
this build failure falls into this category.
-
-* `/Cannot connect to the Docker daemon. Is the docker daemon running on this 
host?/`
-
-## Builds
-
-Links to the build logs:
-
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=centos-7,label=docker/27/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=ubuntu-14.04,label=docker/27/consoleText>
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=default,OS=centos-7,label=docker/27/consoleText>
-
-
-# Failures with reason "libdl"
-
-* Number of failures: 1
-## Regular Expressions
-When one of these regular expression has a match in the build log, I assume 
this build failure falls into this category.
-
-* `/sed: error while loading shared libraries: libdl.so.2/`
-
-## Builds
-
-Links to the build logs:
-
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=debian-8,label=docker/14/consoleText>
-
-
-# Failures with reason "aborted"
-
-* Number of failures: 1
-## Regular Expressions
-When one of these regular expression has a match in the build log, I assume 
this build failure falls into this category.
-
-* `/Build was aborted/`
-
-## Builds
-
-Links to the build logs:
-
-* 
<https://builds.apache.org/job/CouchDB/ERLANG=18.2,OS=centos-7,label=docker/19/consoleText>

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/utils/analyze-jenkins-logs/index.js
----------------------------------------------------------------------
diff --git a/utils/analyze-jenkins-logs/index.js 
b/utils/analyze-jenkins-logs/index.js
deleted file mode 100644
index e0a837f..0000000
--- a/utils/analyze-jenkins-logs/index.js
+++ /dev/null
@@ -1,213 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing,
-//   software distributed under the License is distributed on an
-//   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-//   KIND, either express or implied.  See the License for the
-//   specific language governing permissions and limitations
-//   under the License.
-'use strict';
-
-const _ = require('lodash');
-const fs = require('fs');
-const jsonfile = require('jsonfile');
-const glob = require('glob');
-const path = require('path');
-const process = require('process');
-
-
-let baseDir;
-let success = 0;
-let failure = 0;
-let unrecognized;
-
-// TODO Verify that the errors are indeed in the log file
-
-const reasons = {};
-
-const regexes = {
-  aborted: [ /Build was aborted/ ],
-  network: [
-    /fatal: unable to access 'https:\/\/github.com/,
-  /fatal: read error: Connection reset by peer/,
-  ],
-  docker: [
-    /Cannot connect to the Docker daemon. Is the docker daemon running on this 
host?/
-    ],
-  libdl:  [ /sed: error while loading shared libraries: libdl.so.2/ ],
-  eunit_replicator: [
-    /\\*\\*in function couch_replicator_filtered_tests:should_succeed/,
-  /\\*\\*error:\{assertion_failed,\[\{module,couch_replicator_compact_tests\}/,
-  ],
-  eunit_compression: [
-    /couchdb_file_compression_tests:110: 
should_compare_compression_methods.*\\*failed\\*/,
-  /in call from couchdb_file_compression_tests:setup\/0 
\(test\/couchdb_file_compression_tests.erl, line 38\)/
-    ],
-  eunit: [ /XRROR: One or more eunit tests failed./ ],
-};
-
-// from https://gist.github.com/colingourlay/82506396503c05e2bb94
-_.mixin({
-  'sortKeysBy': function (obj, comparator) {
-    var keys = _.sortBy(_.keys(obj), function (key) {
-      return comparator ? comparator(obj[key], key) : key;
-    });
-
-    return _.zipObject(keys, _.map(keys, function (key) {
-      return obj[key];
-    }));
-  }
-});
-
-function init() {
-  if (!process.env.JENKINS_LOGS_DIR) {
-    console.log('WARNING: JENKINS_LOGS_DIR is not set.\n');
-  }
-  baseDir = process.env.JENKINS_LOGS_DIR || __dirname;
-  // console.log('Will read logs from', baseDir, '\n\n');
-
-  process.on('exit', function() {
-
-    console.log('# Summary');
-    console.log('\nSuccesses:', success, 'Failures:', failure);
-    if (reasons.unrecognized.counter > 0) {
-      console.log('\n\n# Uncategorized Failures');
-      console.log('\n* Number of failures: ' + reasons.unrecognized.counter);
-      console.log('\n## Builds');
-      reasons.unrecognized.urls.forEach( url => {
-        console.log('* <' + url + '>');
-      });
-    }
-
-    // print results, most frequent errors first
-    _(reasons)
-    .omit(['unrecognized'])
-    .sortKeysBy((value, key) => {
-      return -value.counter;
-    })
-    .forOwn((reasonObject, reasonKey) => {
-      console.log('\n\n# Failures with reason "' + reasonKey + '"');
-      console.log('\n* Number of failures: ' + reasonObject.counter);
-      console.log('## Regular Expressions');
-      console.log('When one of these regular expression has a match in the 
build log, I assume this build failure falls into this category.\n');
-      regexes[reasonKey].forEach( regex => {
-        console.log('* `' + regex + '`');
-      });
-      console.log('\n## Builds\n');
-      console.log('Links to the build logs:\n');
-      reasonObject.urls.forEach( url => {
-        console.log('* <' + url + '>');
-      });
-    });
-  });
-}
-
-
-function initReasonObject() {
-  return {
-    counter: 0,
-    urls: [],
-    directories: [],
-  };
-}
-
-
-function analyzeLogs() {
-  init();
-  glob('+([0123456789])/', { cwd: baseDir,  }, function (err, 
buildDirectories) {
-    if (err) {
-      exitOnError(err);
-    }
-    if (buildDirectories.length === 0) {
-      exitOnError(new Error('No matching directories found.'));
-    }
-    buildDirectories.forEach(buildDir => {
-      readBuild(path.join(baseDir, buildDir));
-    });
-  });
-}
-
-
-function readBuild(buildDirectory) {
-  fs.readdir(buildDirectory, function(err, runDirectories) {
-    if (err) {
-      return printWarning(err);
-    }
-    runDirectories.forEach(runDirectory => {
-      readRun(path.join(buildDirectory, runDirectory));
-    });
-  });
-}
-
-
-function readRun(directory) {
-  const metaDataFile = path.join(directory, 'metadata.json');
-  const buildLogFile = path.join(directory, 'build.log');
-  jsonfile.readFile(metaDataFile, 'utf-8', (err, metaData) => {
-    if (err) {
-      return printWarning(err);
-    }
-    const result = metaData.result[0];
-    if (metaData.result[0] !== 'SUCCESS') {
-      // console.error('Failure:', directory, result);
-      failure++;
-      fs.readFile(buildLogFile, 'utf-8', (err, buildLog) => {
-        if (err) {
-          return printWarning(err);
-        }
-
-        for (var key in regexes) {
-          for (var i = 0; i < regexes[key].length; i++) {
-            if (contains(buildLog, regexes[key][i])) {
-              appendToReason(key, metaData, directory);
-              return;
-            }
-          }
-        }
-        // console.error('Uncategorized failure', buildLogFile);
-        appendToReason('unrecognized', metaData, directory);
-      });
-    } else {
-      // console.error('Success:', directory, result);
-      success++;
-    }
-  });
-}
-
-
-function appendToReason(key, metaData, directory) {
-  let reasonObject = reasons[key];
-  if (!reasonObject) {
-    reasonObject = reasons[key] = initReasonObject();
-  }
-  reasonObject.counter++;
-  reasonObject.urls.push(metaData.url + 'consoleText');
-  reasonObject.directories.push(directory);
-}
-
-
-function contains(buildLog, regex) {
-  return buildLog.search(regex) >= 0;
-}
-
-
-function exitOnError(error) {
-  console.error(error);
-  process.exit(1);
-}
-
-
-function printWarning(error) {
-  console.error(error);
-}
-
-
-analyzeLogs();

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/utils/analyze-jenkins-logs/package.json
----------------------------------------------------------------------
diff --git a/utils/analyze-jenkins-logs/package.json 
b/utils/analyze-jenkins-logs/package.json
deleted file mode 100644
index 840f716..0000000
--- a/utils/analyze-jenkins-logs/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "name": "analyze-jenkins-logs",
-  "version": "1.0.0",
-  "description": "Analyzes Jenkins logs for failures",
-  "main": "index.js",
-  "bin": {
-    "analyze-jenkins-logs": "./bin/analyze-jenkins-logs"
-  },
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/apache/couchdb.git";
-  },
-  "author": "The Apache CouchDB contributors",
-  "license": "Apache-2.0",
-  "dependencies": {
-    "glob": "^7.0.0",
-    "jsonfile": "^2.2.3",
-    "lodash": "^4.5.1"
-  }
-}

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/utils/auto-download-jenkins-logs/.gitignore
----------------------------------------------------------------------
diff --git a/utils/auto-download-jenkins-logs/.gitignore 
b/utils/auto-download-jenkins-logs/.gitignore
deleted file mode 100644
index c2658d7..0000000
--- a/utils/auto-download-jenkins-logs/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/utils/auto-download-jenkins-logs/bin/auto-download-jenkins-logs
----------------------------------------------------------------------
diff --git a/utils/auto-download-jenkins-logs/bin/auto-download-jenkins-logs 
b/utils/auto-download-jenkins-logs/bin/auto-download-jenkins-logs
deleted file mode 100755
index 229356d..0000000
--- a/utils/auto-download-jenkins-logs/bin/auto-download-jenkins-logs
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env node
-
-require('..');

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/utils/auto-download-jenkins-logs/index.js
----------------------------------------------------------------------
diff --git a/utils/auto-download-jenkins-logs/index.js 
b/utils/auto-download-jenkins-logs/index.js
deleted file mode 100644
index e2f8413..0000000
--- a/utils/auto-download-jenkins-logs/index.js
+++ /dev/null
@@ -1,198 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing,
-//   software distributed under the License is distributed on an
-//   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-//   KIND, either express or implied.  See the License for the
-//   specific language governing permissions and limitations
-//   under the License.
-'use strict';
-
-const fs = require('fs');
-const isString = require('is-string');
-const jsonfile = require('jsonfile');
-const mkdirp = require('mkdirp');
-const parseXml = require('xml2js').parseString;
-const path = require('path');
-const process = require('process');
-const request = require('request');
-
-const apiXml = 'api/xml';
-let baseDir;
-
-function init() {
-  if (!process.env.JENKINS_LOGS_DIR) {
-    console.log('WARNING: JENKINS_LOGS_DIR is not set.');
-  }
-  baseDir = process.env.JENKINS_LOGS_DIR || __dirname;
-  console.log('Will write logs to', baseDir);
-}
-
-
-function crawlFromRootUrl(url) {
-  console.log(`
-================================================================================
-`);
-  console.log(new Date());
-  init();
-  request(url, function(err, message, body) {
-    if (err) {
-      return exitOnError(err);
-    }
-
-    parseXml(body, function (err, result) {
-      if (err) {
-        return exitOnError(err);
-      }
-
-      if (!result.matrixProject) {
-        return exitOnError(new Error('Not found: matrixProject'));
-      }
-      if (!result.matrixProject.build) {
-        return exitOnError(new Error('Not found: matrixProject.build'));
-      }
-      if (!Array.isArray(result.matrixProject.build)) {
-        return exitOnError(new Error('Not an array: matrixProject.build'));
-      }
-      result.matrixProject.build.forEach(build => {
-        fetchBuild(build);
-      });
-    });
-  });
-}
-
-
-function fetchBuild(build) {
-  if (build.number == null) {
-    return printWarning(new Error('Not found: build.number'));
-  }
-  if (build.url == null) {
-    return printWarning(new Error('Not found: build.url'));
-  }
-
-  const url = build.url + apiXml;
-  console.log('Retrieving meta data for build', build.number[0], 'from ', url);
-  request(url, function(err, message, body) {
-    if (err) {
-      return printWarning(err);
-    }
-    parseXml(body, function (err, result) {
-      if (err) {
-        return printWarning(err);
-      }
-
-      if (!result.matrixBuild) {
-        return printWarning(new Error('Not found: matrixBuild'));
-      }
-      if (!result.matrixBuild.run) {
-        return printWarning(new Error('Not found: matrixBuild.run'));
-      }
-      if (!Array.isArray(result.matrixBuild.run)) {
-        return printWarning(new Error('Not an array: matrixBuild.run'));
-      }
-      result.matrixBuild.run.forEach(run => {
-        fetchRun(run);
-      });
-    });
-  });
-}
-
-
-function fetchRun(run) {
-  if (run.number == null) {
-    return printWarning(new Error('Not found: run.number'));
-  }
-  if (run.url == null) {
-    return printWarning(new Error('Not found: run.url'));
-  }
-
-  const url = run.url + apiXml;
-  console.log('Retrieving meta data for run', run.number[0], 'from ', url);
-  request(url, function(err, message, body) {
-    if (err) {
-      return printWarning(err);
-    }
-    parseXml(body, function (err, result) {
-      if (err) {
-        return printWarning(err);
-      }
-
-      if (!result.matrixRun) {
-        return printWarning(new Error('Not found: matrixRun'));
-      }
-      if (!result.matrixRun.number) {
-        return printWarning(new Error('Not found: matrixRun.number'));
-      }
-      if (!result.matrixRun.fullDisplayName) {
-        return printWarning(new Error('Not found: matrixRun.fullDisplayName'));
-      }
-      if (!Array.isArray(result.matrixRun.fullDisplayName)) {
-        return printWarning(new Error('Not an array: 
matrixRun.fullDisplayName'));
-
-      }
-      if (result.matrixRun.fullDisplayName.length !== 1) {
-        return printWarning(new Error('Not an array of length 1: 
matrixRun.fullDisplayName'));
-      }
-      if (!isString(result.matrixRun.fullDisplayName[0])) {
-        return printWarning(new Error('Not a string: 
matrixRun.fullDisplayName[0]'));
-      }
-
-      fetchMatrixRunAndLog(result.matrixRun, run.url);
-    });
-  });
-}
-
-
-function fetchMatrixRunAndLog(metaData, runBaseUrl) {
-  const logUrl = runBaseUrl + 'consoleText';
-  request(logUrl, function(err, message, body) {
-    if (err) {
-      return printWarning(err);
-    }
-    saveToDisk(metaData, body);
-  });
-}
-
-
-function saveToDisk(metaData, buildLog) {
-  const dir = path.join(baseDir, String(metaData.number), 
metaData.fullDisplayName[0]);
-  mkdirp.sync(dir);
-  const metaDataFile = path.join(dir, 'metadata.json');
-  jsonfile.writeFile(metaDataFile, metaData, { spaces: 2 }, function (err) {
-    if (err) {
-      return printWarning(err);
-    }
-    console.log('Written meta data to ', metaDataFile);
-  });
-  const buildLogFile = path.join(dir, 'build.log');
-  fs.writeFile(buildLogFile, buildLog, function(err) {
-    if (err) {
-      return printWarning(err);
-    }
-    console.log('Written build log to ', buildLogFile);
-  });
-}
-
-
-function exitOnError(error) {
-  console.error(error);
-  process.exit(1);
-}
-
-
-function printWarning(error) {
-  console.error(error);
-}
-
-
-const rootUrl = 'https://builds.apache.org/job/CouchDB/api/xml';
-
-crawlFromRootUrl(rootUrl);

http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/c468e27a/utils/auto-download-jenkins-logs/package.json
----------------------------------------------------------------------
diff --git a/utils/auto-download-jenkins-logs/package.json 
b/utils/auto-download-jenkins-logs/package.json
deleted file mode 100644
index 44105bd..0000000
--- a/utils/auto-download-jenkins-logs/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-  "name": "auto-download-jenkins-logs",
-  "version": "1.0.0",
-  "description": "Automatically downloads Jenkins logs",
-  "main": "index.js",
-  "bin": {
-    "auto-download-jenkins-logs": "./bin/auto-download-jenkins-logs"
-  },
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/apache/couchdb.git";
-  },
-  "author": "The Apache CouchDB contributors",
-  "license": "Apache-2.0",
-  "dependencies": {
-    "jsonfile": "^2.2.3",
-    "mkdirp": "^0.5.1",
-    "request": "^2.69.0",
-    "xml2js": "^0.4.16"
-  },
-  "devDependencies": {
-    "is-string": "^1.0.4"
-  }
-}

Reply via email to