From d9c1b419066ec47819cc9c036eb9c67c7ea3663e Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 1 Jul 2014 15:51:07 +1000 Subject: [PATCH] FIX: checkout correct branch in base image. --- image/discourse/Dockerfile | 11 +++++++---- image/discourse_21/Dockerfile | 29 +++++++++++------------------ launcher | 2 +- templates/web.template.yml | 4 ++-- 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/image/discourse/Dockerfile b/image/discourse/Dockerfile index 7a34e8a..6fe5ed8 100644 --- a/image/discourse/Dockerfile +++ b/image/discourse/Dockerfile @@ -1,3 +1,4 @@ +# Current version 0.2.5 FROM samsaffron/discourse_base:0.2.3 MAINTAINER Sam Saffron "https://twitter.com/samsaffron" @@ -5,15 +6,17 @@ MAINTAINER Sam Saffron "https://twitter.com/samsaffron" # Discourse specific bits RUN useradd discourse -s /bin/bash -m -U &&\ mkdir /var/www && cd /var/www &&\ - git clone --depth 1 https://github.com/discourse/discourse.git &&\ + git clone https://github.com/discourse/discourse.git &&\ + cd discourse &&\ + git remote set-branches origin tests-passed &&\ + cd .. &&\ chown -R discourse:discourse /var/www/discourse &&\ cd /var/www/discourse &&\ sudo -u discourse RAILS4=1 bundle install --deployment \ --without test --without development &&\ cd /var/www/discourse/vendor/bundle &&\ - find . -name tmp -type d | xargs rm -rf && cd / - -RUN wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ + find . -name tmp -type d | xargs rm -rf && cd / &&\ + wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ tar -xjf phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ rm phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ cp phantomjs-1.9.7-linux-x86_64/bin/phantomjs /bin/phantomjs &&\ diff --git a/image/discourse_21/Dockerfile b/image/discourse_21/Dockerfile index a0735a2..bd18156 100644 --- a/image/discourse_21/Dockerfile +++ b/image/discourse_21/Dockerfile @@ -1,29 +1,22 @@ +# Current version 2.1.2.2 FROM samsaffron/discourse_base_21:2.1.2.1 MAINTAINER Sam Saffron "https://twitter.com/samsaffron" -# Discourse specific bits RUN useradd discourse -s /bin/bash -m -U &&\ mkdir /var/www && cd /var/www &&\ - git clone --depth 1 https://github.com/discourse/discourse.git &&\ + git clone https://github.com/discourse/discourse.git &&\ + cd discourse &&\ + git remote set-branches origin tests-passed &&\ + cd .. &&\ chown -R discourse:discourse /var/www/discourse &&\ cd /var/www/discourse &&\ sudo -u discourse RAILS4=1 bundle install --deployment \ --without test --without development &&\ cd /var/www/discourse/vendor/bundle &&\ - find . -name tmp -type d | xargs rm -rf && cd / - - -# For a smaller but less flexible image: -#RUN apt-get -y autoremove build-essential gcc gcc-4.7 .+-dev -#RUN echo image size: $(du -hsx /) - -# RUN cd /var/www/discourse && bundle exec rake db:test:prepare && bundle exec rspec - -# mkdir -p /src/godeb && cd /src/godeb && curl -O https://godeb.s3.amazonaws.com/godeb-amd64.tar.gz &&\ -# cd /src/godeb && tar -xzvf godeb-amd64.tar.gz &&\ -# cd /src/godeb && ./godeb install &&\ -# cd /src && git clone https://github.com/coreos/etcd.git &&\ -# cd /src/etcd && ./build &&\ -# cp /src/etcd/etcd /usr/local/bin &&\ -# add-apt-repository ppa:chris-lea/node.js &&\ + find . -name tmp -type d | xargs rm -rf && cd / &&\ + wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ + tar -xjf phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ + rm phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ + cp phantomjs-1.9.7-linux-x86_64/bin/phantomjs /bin/phantomjs &&\ + rm -fr phantomjs-1.9.7-linux-x86_64 diff --git a/launcher b/launcher index 0ef7680..e79b893 100755 --- a/launcher +++ b/launcher @@ -13,7 +13,7 @@ config_file=containers/"$config".yml cidfile=cids/"$config".cid cidbootstrap=cids/"$config"_boostrap.cid local_discourse=local_discourse -image=samsaffron/discourse:0.2.4 +image=samsaffron/discourse:0.2.5 docker_path=`which docker.io || which docker` docker_ip=`/sbin/ifconfig | \ diff --git a/templates/web.template.yml b/templates/web.template.yml index 7bc261a..fa5a6b7 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -64,9 +64,9 @@ run: cmd: - git reset --hard - git clean -f - - git branch $version || echo branch exists + - git pull + - git fetch origin $version - git checkout $version - - git pull origin $version - mkdir -p tmp/pids - mkdir -p tmp/sockets - mkdir -p /shared/log/rails -- 2.25.1