Repository: yetus Updated Branches: refs/heads/master 7af796d0c -> 3e3347aca
YETUS-335. switch Yetus Dockerfile to use ruby 2.0 Signed-off-by: Sean Busbey <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/3e3347ac Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/3e3347ac Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/3e3347ac Branch: refs/heads/master Commit: 3e3347acadbf63d00fbe29d349ce75b9c12a1b2b Parents: 7af796d Author: Allen Wittenauer <[email protected]> Authored: Tue Mar 15 11:45:26 2016 -0700 Committer: Allen Wittenauer <[email protected]> Committed: Wed Mar 16 12:24:13 2016 -0700 ---------------------------------------------------------------------- .../in-progress/precommit-basic.md | 2 +- precommit/core.d/docker.sh | 4 ++-- precommit/test-patch-docker/Dockerfile | 23 +++++++++++++++++--- 3 files changed, 23 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/3e3347ac/asf-site-src/source/documentation/in-progress/precommit-basic.md ---------------------------------------------------------------------- diff --git a/asf-site-src/source/documentation/in-progress/precommit-basic.md b/asf-site-src/source/documentation/in-progress/precommit-basic.md index 41c035d..4de0f63 100644 --- a/asf-site-src/source/documentation/in-progress/precommit-basic.md +++ b/asf-site-src/source/documentation/in-progress/precommit-basic.md @@ -171,7 +171,7 @@ For example: $ test-patch.sh --robot --patch-dir=${WORKSPACE}/patchprocess --basedir=${WORKSPACE}/source ${WORKSPACE}/patchfile ``` -... will trigger test-patch to run in fully automated mode, using ${WORKSPACE}/patchprocess as its scratch space, ${WORKSPACE}/source as the source repository, and ${WORKSPACE}/patchfile as the name of the patch to test against. This will always run the unit tests, write answers back to bug systems, remove old, stopped/exited Docker images and containers after 24 hours, forcibly use --resetrepo, and more. The --build-url option is also useful when running in --robot mode so that emails and such +... will trigger test-patch to run in fully automated mode, using ${WORKSPACE}/patchprocess as its scratch space, ${WORKSPACE}/source as the source repository, and ${WORKSPACE}/patchfile as the name of the patch to test against. This will always run the unit tests, write answers back to bug systems, remove old, stopped/exited Docker containers after 24 hours and images after 1 week, forcibly use --resetrepo, and more. The --build-url option is also useful when running in --robot mode so that emails and such have a location to look at the output artifacts: ```bash http://git-wip-us.apache.org/repos/asf/yetus/blob/3e3347ac/precommit/core.d/docker.sh ---------------------------------------------------------------------- diff --git a/precommit/core.d/docker.sh b/precommit/core.d/docker.sh index 41a1afa..e0706a3 100755 --- a/precommit/core.d/docker.sh +++ b/precommit/core.d/docker.sh @@ -32,8 +32,8 @@ DOCKER_ENABLE_PRIVILEGED=true # stopped, exited, running, for 24 hours DOCKER_CONTAINER_PURGE=("86400" "86400" "86400") -# keep images for 24 hours -DOCKER_IMAGE_PURGE=86400 +# keep images for 1 week +DOCKER_IMAGE_PURGE=604800 ## @description Docker-specific usage ## @stability stable http://git-wip-us.apache.org/repos/asf/yetus/blob/3e3347ac/precommit/test-patch-docker/Dockerfile ---------------------------------------------------------------------- diff --git a/precommit/test-patch-docker/Dockerfile b/precommit/test-patch-docker/Dockerfile index 4e9fa5d..196d325 100644 --- a/precommit/test-patch-docker/Dockerfile +++ b/precommit/test-patch-docker/Dockerfile @@ -28,7 +28,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ build-essential libtool \ autoconf automake \ python python2.7 pylint \ - ruby openjdk-7-jdk \ + openjdk-7-jdk \ libperl-critic-perl # Fixing the Apache commons / Maven dependency problem under Ubuntu: @@ -68,14 +68,31 @@ RUN apt-get install -y cabal-install RUN cabal update && cabal install shellcheck --global #### +# Install ruby +### +RUN echo 'gem: --no-rdoc --no-ri' >> /root/.gemrc +RUN apt-get install -y ruby2.0 +# +# on trusty, the above installs ruby2.0 and ruby (1.9.3) exes +# but update-alternatives is broken, so we need to do some work +# to make 2.0 actually the default without the system flipping out +# +# See https://bugs.launchpad.net/ubuntu/+source/ruby2.0/+bug/1310292 +# +RUN dpkg-divert --add --rename --divert /usr/bin/ruby.divert /usr/bin/ruby +RUN dpkg-divert --add --rename --divert /usr/bin/gem.divert /usr/bin/gemrc +RUN update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby2.0 1 +RUN update-alternatives --install /usr/bin/gem gem /usr/bin/gem2.0 1 + +#### # Install rubocop ### -RUN gem install rubocop --no-ri --no-rdoc +RUN gem install rubocop #### # Install ruby-lint ### -RUN gem install ruby-lint --no-ri --no-rdoc +RUN gem install ruby-lint #### # Install bats
