From 81455ef2119386505d89a90bfe1c9c21b10f7ccc Mon Sep 17 00:00:00 2001 From: Andrew Vos Date: Sun, 20 Jul 2014 00:14:35 +0100 Subject: [PATCH] Add scripts to `rake test` on all rubies Run ./multi_test.sh to test all rubies that are configured in Dockerfile. --- Dockerfile | 15 +++++++++++++++ multi_test.sh | 4 ++++ multi_test_inside_docker.sh | 24 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 Dockerfile create mode 100755 multi_test.sh create mode 100755 multi_test_inside_docker.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e55c246c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:latest + +RUN apt-get update -y +RUN apt-get install -y wget make git + +RUN wget --no-check-certificate -O ruby-install-0.4.3.tar.gz https://github.com/postmodern/ruby-install/archive/v0.4.3.tar.gz +RUN tar -xzvf ruby-install-0.4.3.tar.gz +RUN cd ruby-install-0.4.3 && make install + +RUN ruby-install ruby 1.9.3 +RUN ruby-install ruby 2.1.1 +RUN ruby-install ruby 2.1.2 + +ADD . /pry +WORKDIR /pry diff --git a/multi_test.sh b/multi_test.sh new file mode 100755 index 00000000..87df12af --- /dev/null +++ b/multi_test.sh @@ -0,0 +1,4 @@ +#!/bin/bash -e + +docker build -t pry/pry . +docker run -i -t -v /tmp/prytmp:/tmp/prytmp pry/pry ./multi_test_inside_docker.sh diff --git a/multi_test_inside_docker.sh b/multi_test_inside_docker.sh new file mode 100755 index 00000000..4d713815 --- /dev/null +++ b/multi_test_inside_docker.sh @@ -0,0 +1,24 @@ +#!/bin/bash -e + +export ORIGINAL_PATH=$PATH + +function test { + version=$1 + export PATH=$ORIGINAL_PATH + + export GEM_HOME=/tmp/prytmp/$version + export PATH=/opt/rubies/$version/bin:$GEM_HOME/bin:$PATH + export RUBY_ROOT=/opt/rubies/$version + + if [ ! -f $GEM_HOME/bin/bundle ]; then + gem install bundler --no-rdoc --no-ri + fi + + bundle install --quiet + rake test +} + +for ruby in `ls /opt/rubies` +do + test $ruby || : +done