Bug 1102962: update Dockerfile with MPL header and s/RUN/ADD/
authorBen Kero <bkero@mozilla.com>
Mon, 24 Nov 2014 14:11:14 -0800
changeset 359939 d340711f1e5abff86232bfade4368e4f29c0f9f7
parent 359938 8809fe3fdfa3d11f18b61a47906da397031495f8
child 359940 b3d154e22d9e689728d2d5cc091cddc3b98abe88
push id16998
push userrwood@mozilla.com
push dateMon, 02 May 2016 19:42:03 +0000
bugs1102962
Bug 1102962: update Dockerfile with MPL header and s/RUN/ADD/ Replaces many extraneous RUN cp -a's with ADDs Removes pulse.mozlila.org configuration from the hgrc file
testing/docker/builder-hgmaster/Dockerfile
testing/docker/builder-hgmaster/hgrc
--- a/testing/docker/builder-hgmaster/Dockerfile
+++ b/testing/docker/builder-hgmaster/Dockerfile
@@ -1,8 +1,18 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# This Dockerfile creates a docker container for running a Mercurial server
+# that is ideally indistinguishable from the production hg.mozilla.org SSH
+# server. It installs Mercurial, adds some users and groups, and scripts
+# that mirror production (or what production will be). Should accompany
+# the hgweb-slave script.
+
 FROM centos:centos6
 MAINTAINER Ben Kero <bkero@mozilla.com>
 
 # Install requisite packages
 RUN yum install -y update; yum clean all
 RUN yum install -y openssh-server git sudo; yum clean all
 RUN yum localinstall -y http://people.mozilla.org/~bkero/mercurial-3.2.1+2-3246801ff313.x86_64.rpm
 
@@ -17,51 +27,48 @@ RUN useradd guest; echo guest:guest|chpa
 RUN mkdir -p /home/guest; chown guest:guest /home/guest
 
 # Add the hg user
 RUN useradd hg
 
 # Set root password to something for debugging purposes
 RUN echo root:mozillafirefox|chpasswd
 
-# Add the vct-repo files
-ADD extra /extra
-
 # Set up Mercurial, adding example content
 RUN mkdir -p /etc/mercurial
 RUN mkdir -p /repo_local/mozilla/mozilla /repo_local/mozilla/extensions /repo_local/mozilla/scripts /repo
 RUN ln -sf /repo_local/mozilla /repo/hg
 
 # Clone the xforms repo as a small example repository
 RUN hg clone -U https://hg.mozilla.org/xforms /repo/hg/mozilla/xforms; chmod -R 2775 /repo/hg/mozilla/xforms; chown -R hg:scm_level_1 /repo/hg/mozilla/xforms
 
 # Set up users directories, make permissions right
 RUN mkdir -p /repo_local/mozilla/mozilla/users
 RUN chmod 2775 /repo_local/mozilla/mozilla/users
 RUN chown -R hg:scm_level_1 /repo_local/mozilla/mozilla/users
 
 # Install Mercurial config files
-RUN cp /extra/vct/testing/docker/builder-hgmaster/hgrc /etc/mercurial/hgrc
+ADD extra/vct/testing/docker/builder-hgmaster/hgrc /etc/mercurial/hgrc
 
 # TODO: Write up the client and re-enable the mirror push script
 RUN sed -i 's/changegroup.mirrorpush/#changegroup.mirrorpush/' /etc/mercurial/hgrc
 
 # Copy scripts into place
-RUN cp -rv /extra/vct/hgext/pushlog-legacy/* /repo/hg/extensions/
-RUN cp -rv /extra/vct/hgext/serverlog /repo/hg/extensions/
-RUN cp -rv /extra/vct/hghooks /repo/hg/libraries/
-RUN cp -rv extra/vct/scripts/record-pushes.sh /repo/hg/scripts/
-RUN cp -rv /extra/vct/scripts/push-repo.sh /repo/hg/scripts/
-RUN cp -rv extra/vct/scripts/repo-push.sh /usr/local/bin/
+ADD extra/vct/hgext/pushlog-legacy/* /repo/hg/extensions/
+ADD extra/vct/hgext/serverlog /repo/hg/extensions/
+ADD extra/vct/hghooks /repo/hg/libraries/
+ADD extra/vct/scripts/record-pushes.sh /repo/hg/scripts/
+ADD extra/vct/scripts/push-repo.sh /repo/hg/scripts/
+ADD extra/vct/scripts/repo-push.sh /usr/local/bin/
 
 # TODO: Fix this logging or remove record-pushes script as it's information duplicates serverlog
 RUN touch /var/log/hg-push.log; chmod 666 /var/log/hg-push.log
 
 # Put the files in the right place
-RUN cp -v /extra/vct/scripts/pash/* /usr/local/bin/
+ADD extra/vct/scripts/pash/* /usr/local/bin/
 
 # TODO: Set up an LDAP container, run tests against it
 # Comment out the ldap nastiness
 RUN sed -i 's/, ldap_helper//; s/ .*ldap_helper.*/           pass/' /usr/local/bin/pash.py
 RUN sed -i 's/^from ldap_helper.*//; s/    account_status =.*/    return 1/' /usr/local/bin/hg_helper.py
 
 # Fix path in pash.py
 RUN sed -i "s/'\/repo_local\/mozilla/'\/repo_local\/mozilla\/mozilla/" /usr/local/bin/hg_helper.py
--- a/testing/docker/builder-hgmaster/hgrc
+++ b/testing/docker/builder-hgmaster/hgrc
@@ -39,18 +39,11 @@ buglink = /repo/hg/extensions/buglink.py
 serverlog = /repo/hg/extensions/serverlog
 #highlight =
 #interhg =
 
 [interhg]
 a_httplinks = s|(https?://\S+)|<a href="\1">\1</a>|i
 bugzilla = s|((?:bug[\s#]*|b=#?|#)(\d{4,}))|<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=\2" title="Bug \2">\1</a>|i
 
-[broker]
-BROKER_HOST = pulse.mozilla.org
-BROKER_USER = hg_shim
-BROKER_PASS = W3_l1ke_f1x3s
-MSG_EXCHANGE = org.mozilla.exchange.code
-BASE_PATH = /repo/hg/mozilla
-
 [serverlog]
 reporoot = /repo/hg/mozilla/