Skip to content

Commit

Permalink
Import all of the build files and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
edgester committed Nov 29, 2013
1 parent 5666f8d commit b4eaeb5
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 0 deletions.
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# gerrit
#
# VERSION 0.0.1

#FROM ubuntu
FROM edgester/ubuntu-jdk

MAINTAINER Jason W. Edgecombe <[email protected]>

ENV GERRIT_HOME /home/gerrit/gerrit
ENV GERRIT_USER gerrit
ENV GERRIT_WAR /home/gerrit/gerrit.war

RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list

RUN IPADDR=$( ip route | grep default | awk '{print $3}' ) ;echo "Acquire::http { Proxy \"http://$IPADDR:3142\"; };"| tee -a /etc/apt/apt.conf.d/01proxy

RUN apt-get update
#RUN apt-get upgrade

RUN useradd -m $GERRIT_USER
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-6-jre-headless sudo git-core net-tools supervisor vim-tiny
RUN mkdir -p /var/run/sshd
RUN mkdir -p /var/log/supervisor

ADD gerrit.war /tmp/gerrit.war
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf

RUN mkdir -p $GERRIT_HOME
RUN chown ${GERRIT_USER}.${GERRIT_USER} $GERRIT_HOME

RUN mv /tmp/gerrit.war $GERRIT_WAR

RUN chown -R ${GERRIT_USER}.${GERRIT_USER} $GERRIT_HOME

USER gerrit
RUN java -jar $GERRIT_WAR init --batch -d $GERRIT_HOME

# clobber the gerrit config. set the URL to localhost:8080
ADD gerrit.config /home/gerrit/gerrit/etc/gerrit.config

USER root
EXPOSE 8080 29418
#CMD ["/usr/bin/supervisord"]
CMD ["/usr/sbin/service","supervisor","start"]
3 changes: 3 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
docker rmi edgester/gerrit
docker build -rm -t edgester/gerrit .
19 changes: 19 additions & 0 deletions gerrit.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[gerrit]
basePath = git
canonicalWebUrl = http://localhost:8080/
[database]
type = H2
database = db/ReviewDB
[auth]
type = OPENID
[sendemail]
smtpServer = localhost
[container]
user = gerrit
javaHome = /usr/lib/jvm/java-6-openjdk-amd64/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://*:8080/
[cache]
directory = cache
2 changes: 2 additions & 0 deletions run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker run -p 127.0.0.1:8080:8080 -p 127.0.0.1:29418:29418 edgester/gerrit $*
2 changes: 2 additions & 0 deletions run-daemon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker run -p 127.0.0.1:8080:8080 -p 127.0.0.1:29418:29418 -d edgester/gerrit $*
2 changes: 2 additions & 0 deletions run-interactive
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker run -p 127.0.0.1:8080:8080 -p 127.0.0.1:29418:29418 -i -t edgester/gerrit $*
5 changes: 5 additions & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[supervisord]
nodaemon=true

[program:gerrit]
command=/bin/bash -c "/home/gerrit/gerrit/bin/gerrit.sh start"

0 comments on commit b4eaeb5

Please sign in to comment.