From 7b20b622b3a007b50c15e8cb4c94474561663a6b Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Mon, 11 Sep 2017 00:16:16 -0500 Subject: [PATCH 01/11] Set docker-compose and run test playbook --- tests/ansible.cfg | 3 ++ tests/docker-compose.yml | 6 ++++ tests/dockerfiles/debian8/Dockerfile | 21 ++++++++++++++ tests/dockerfiles/debian8/build | 42 ++++++++++++++++++++++++++++ tests/inventory | 3 +- tests/test.yml | 14 ++++------ 6 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 tests/ansible.cfg create mode 100644 tests/docker-compose.yml create mode 100644 tests/dockerfiles/debian8/Dockerfile create mode 100644 tests/dockerfiles/debian8/build diff --git a/tests/ansible.cfg b/tests/ansible.cfg new file mode 100644 index 0000000..2a87e76 --- /dev/null +++ b/tests/ansible.cfg @@ -0,0 +1,3 @@ +[defaults] +inventory = inventory +roles_path = ../../ diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml new file mode 100644 index 0000000..2dcf065 --- /dev/null +++ b/tests/docker-compose.yml @@ -0,0 +1,6 @@ +version: "3" +services: + debian8: + build: ./dockerfiles/debian8 + cap_add: + - ALL diff --git a/tests/dockerfiles/debian8/Dockerfile b/tests/dockerfiles/debian8/Dockerfile new file mode 100644 index 0000000..e5161c9 --- /dev/null +++ b/tests/dockerfiles/debian8/Dockerfile @@ -0,0 +1,21 @@ +FROM debian:8 + +WORKDIR /opt/ + +RUN apt-get update && \ + apt-get install -y \ + curl \ + build-essential \ + libbz2-dev \ + libffi-dev \ + libncurses5-dev \ + libreadline-dev \ + libssl-dev \ + sudo \ + wget \ + && rm -rf /var/lib/apt/lists/* + +COPY build /opt/build +RUN bash build + +CMD ["/sbin/init"] diff --git a/tests/dockerfiles/debian8/build b/tests/dockerfiles/debian8/build new file mode 100644 index 0000000..22b5947 --- /dev/null +++ b/tests/dockerfiles/debian8/build @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +PI=/opt +EXPECTED_VERSION="2.7.10" + +get_source(){ + wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz + tar xvf Python-2.7.10.tar.xz + cd Python-2.7.10 + } + +install_configure(){ + ./configure + make + make install + } + +remove(){ + rm $PI/Python-2.7.10.tar.xz + rm -rf $PI/Python-2.7.10 + } + +update_alternatives(){ + update-alternatives --install /usr/bin/python python /usr/local/bin/python 10 + } + +version(){ + VERSION=$(python -c "print __import__('sys').version[0:6]") + + if [ "$VERSION" == "$EXPECTED_VERSION" ]; + then echo "Python $VERSION installed OK"; + else echo "FAIL"; + fi + } + +cd $PI +get_source +install_configure +update_alternatives +remove + +version diff --git a/tests/inventory b/tests/inventory index d18580b..5d80faa 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1 +1,2 @@ -localhost \ No newline at end of file +[debian] +tests_debian8_1 ansible_connection=docker diff --git a/tests/test.yml b/tests/test.yml index a74e05b..0ca4e8f 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -1,14 +1,12 @@ --- - -- hosts: localhost - remote_user: travis - +- hosts: all + gather_facts: false vars: rvm1_rubies: - 'ruby-2.2.5' - 'ruby-2.3.1' - rvm1_install_path: '/home/travis/.rvm' - rvm1_user: travis - + rvm1_install_path: '/home/{{ rvm1_user }}/.rvm' + rvm1_install_flags: '--auto-dotfiles' + rvm1_user: root roles: - - rvm1-ansible + - role: rvm1-ansible From 37b4d975d37e22d5dada7aa61ce3d0322722d134 Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Mon, 11 Sep 2017 23:50:26 -0500 Subject: [PATCH 02/11] Test in debian 9, ubuntu 14.04 and ubuntu 16.04 --- tests/docker-compose.yml | 4 +++ tests/dockerfiles/debian8/Dockerfile | 3 +- tests/dockerfiles/debian9/Dockerfile | 14 +++++++++ tests/dockerfiles/ubuntu14/Dockerfile | 22 ++++++++++++++ tests/dockerfiles/ubuntu14/build | 42 +++++++++++++++++++++++++++ tests/dockerfiles/ubuntu16/Dockerfile | 12 ++++++++ tests/inventory | 1 + tests/{test.yml => test_root.yml} | 4 +-- tests/test_user.yml | 11 +++++++ 9 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 tests/dockerfiles/debian9/Dockerfile create mode 100644 tests/dockerfiles/ubuntu14/Dockerfile create mode 100644 tests/dockerfiles/ubuntu14/build create mode 100644 tests/dockerfiles/ubuntu16/Dockerfile rename tests/{test.yml => test_root.yml} (100%) create mode 100644 tests/test_user.yml diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 2dcf065..ff7eef8 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -4,3 +4,7 @@ services: build: ./dockerfiles/debian8 cap_add: - ALL + debian9: + build: ./dockerfiles/debian9 + cap_add: + - ALL diff --git a/tests/dockerfiles/debian8/Dockerfile b/tests/dockerfiles/debian8/Dockerfile index e5161c9..abda47e 100644 --- a/tests/dockerfiles/debian8/Dockerfile +++ b/tests/dockerfiles/debian8/Dockerfile @@ -1,6 +1,6 @@ FROM debian:8 -WORKDIR /opt/ +RUN useradd -ms /bin/bash user RUN apt-get update && \ apt-get install -y \ @@ -15,6 +15,7 @@ RUN apt-get update && \ wget \ && rm -rf /var/lib/apt/lists/* +WORKDIR /opt/ COPY build /opt/build RUN bash build diff --git a/tests/dockerfiles/debian9/Dockerfile b/tests/dockerfiles/debian9/Dockerfile new file mode 100644 index 0000000..4c94901 --- /dev/null +++ b/tests/dockerfiles/debian9/Dockerfile @@ -0,0 +1,14 @@ +FROM debian:9 + +RUN useradd -ms /bin/bash user + +RUN apt-get update && \ + apt-get install -y \ + curl \ + gpg \ + python \ + sudo \ + systemd \ + && rm -rf /var/lib/apt/lists/* + +CMD ["/bin/systemd"] diff --git a/tests/dockerfiles/ubuntu14/Dockerfile b/tests/dockerfiles/ubuntu14/Dockerfile new file mode 100644 index 0000000..b1e04da --- /dev/null +++ b/tests/dockerfiles/ubuntu14/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:14.04 + +RUN useradd -ms /bin/bash user + +RUN apt-get update && \ + apt-get install -y \ + curl \ + build-essential \ + libbz2-dev \ + libffi-dev \ + libncurses5-dev \ + libreadline-dev \ + libssl-dev \ + sudo \ + wget \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /opt/ +COPY build /opt/build +RUN bash build + +CMD ["/sbin/init"] diff --git a/tests/dockerfiles/ubuntu14/build b/tests/dockerfiles/ubuntu14/build new file mode 100644 index 0000000..0b6f86a --- /dev/null +++ b/tests/dockerfiles/ubuntu14/build @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +PI=/opt +EXPECTED_VERSION="2.7.10" + +get_source(){ + wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz + tar xvf Python-2.7.10.tar.xz + cd Python-2.7.10 + } + +install_configure(){ + ./configure + make + make install + } + +remove(){ + rm $PI/Python-2.7.10.tar.xz + rm -rf $PI/Python-2.7.10 + } + +update_alternatives(){ + update-alternatives --install /usr/bin/python python /usr/local/bin/python 10 + } + +version(){ + VERSION=$(python -c "print __import__('sys').version[0:6]") + + if [ "$VERSION" == "$EXPECTED_VERSION" ]; + then echo "Python $VERSION installed OK"; + else echo "FAIL"; + fi + } + +cd $PI +get_source +install_configure +update_alternatives +remove + +version diff --git a/tests/dockerfiles/ubuntu16/Dockerfile b/tests/dockerfiles/ubuntu16/Dockerfile new file mode 100644 index 0000000..2b637e3 --- /dev/null +++ b/tests/dockerfiles/ubuntu16/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:16.04 + +RUN useradd -ms /bin/bash user + +RUN apt-get update && \ + apt-get install -y \ + curl \ + python \ + sudo \ + && rm -rf /var/lib/apt/lists/* + +CMD ["/sbin/init"] diff --git a/tests/inventory b/tests/inventory index 5d80faa..a48fe29 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1,2 +1,3 @@ [debian] tests_debian8_1 ansible_connection=docker +tests_debian9_1 ansible_connection=docker diff --git a/tests/test.yml b/tests/test_root.yml similarity index 100% rename from tests/test.yml rename to tests/test_root.yml index 0ca4e8f..789a0b0 100644 --- a/tests/test.yml +++ b/tests/test_root.yml @@ -2,11 +2,11 @@ - hosts: all gather_facts: false vars: + rvm1_user: root + rvm1_install_flags: '--auto-dotfiles' rvm1_rubies: - 'ruby-2.2.5' - 'ruby-2.3.1' rvm1_install_path: '/home/{{ rvm1_user }}/.rvm' - rvm1_install_flags: '--auto-dotfiles' - rvm1_user: root roles: - role: rvm1-ansible diff --git a/tests/test_user.yml b/tests/test_user.yml new file mode 100644 index 0000000..e22bd70 --- /dev/null +++ b/tests/test_user.yml @@ -0,0 +1,11 @@ +--- +- hosts: all + gather_facts: false + vars: + rvm1_user: user + rvm1_install_path: '/home/{{ rvm1_user }}/.rvm' + rvm1_rubies: + - 'ruby-2.2.5' + - 'ruby-2.3.1' + roles: + - role: rvm1-ansible From 4d94ef7588fa97776b5eec3345c3a7e7a5758ad9 Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Sat, 16 Sep 2017 15:00:29 -0500 Subject: [PATCH 03/11] Support centos6 and centos7 --- .gitignore | 3 ++- tests/docker-compose.yml | 16 ++++++++++++++++ tests/dockerfiles/centos6/Dockerfile | 11 +++++++++++ tests/dockerfiles/centos7/Dockerfile | 11 +++++++++++ tests/dockerfiles/debian8/Dockerfile | 20 ++++++++++---------- tests/dockerfiles/debian9/Dockerfile | 10 +++++----- tests/dockerfiles/ubuntu14/Dockerfile | 20 ++++++++++---------- tests/dockerfiles/ubuntu16/Dockerfile | 6 +++--- tests/inventory | 6 ++++++ 9 files changed, 74 insertions(+), 29 deletions(-) create mode 100644 tests/dockerfiles/centos6/Dockerfile create mode 100644 tests/dockerfiles/centos7/Dockerfile diff --git a/.gitignore b/.gitignore index fab7220..37d4c60 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ ._* .*.sw* *~ -.idea/ \ No newline at end of file +.idea/ +*.retry diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index ff7eef8..3f71c4f 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -1,5 +1,13 @@ version: "3" services: + centos6: + build: ./dockerfiles/centos6 + cap_add: + - ALL + centos7: + build: ./dockerfiles/centos7 + cap_add: + - ALL debian8: build: ./dockerfiles/debian8 cap_add: @@ -8,3 +16,11 @@ services: build: ./dockerfiles/debian9 cap_add: - ALL + ubuntu14: + build: ./dockerfiles/ubuntu14 + cap_add: + - ALL + ubuntu16: + build: ./dockerfiles/ubuntu16 + cap_add: + - ALL diff --git a/tests/dockerfiles/centos6/Dockerfile b/tests/dockerfiles/centos6/Dockerfile new file mode 100644 index 0000000..1792c95 --- /dev/null +++ b/tests/dockerfiles/centos6/Dockerfile @@ -0,0 +1,11 @@ +FROM centos:6 + +RUN useradd -ms /bin/bash user + +RUN yum update -y && \ + yum install -y \ + initscripts \ + sudo \ + && yum clean all + +CMD ["/sbin/init"] diff --git a/tests/dockerfiles/centos7/Dockerfile b/tests/dockerfiles/centos7/Dockerfile new file mode 100644 index 0000000..4cc0792 --- /dev/null +++ b/tests/dockerfiles/centos7/Dockerfile @@ -0,0 +1,11 @@ +FROM centos:7 + +RUN useradd -ms /bin/bash user + +RUN yum update -y && \ + yum install -y \ + sudo \ + which \ + && yum clean all + +CMD ["/usr/sbin/init"] diff --git a/tests/dockerfiles/debian8/Dockerfile b/tests/dockerfiles/debian8/Dockerfile index abda47e..5ec183c 100644 --- a/tests/dockerfiles/debian8/Dockerfile +++ b/tests/dockerfiles/debian8/Dockerfile @@ -3,16 +3,16 @@ FROM debian:8 RUN useradd -ms /bin/bash user RUN apt-get update && \ - apt-get install -y \ - curl \ - build-essential \ - libbz2-dev \ - libffi-dev \ - libncurses5-dev \ - libreadline-dev \ - libssl-dev \ - sudo \ - wget \ + apt-get install -y \ + curl \ + build-essential \ + libbz2-dev \ + libffi-dev \ + libncurses5-dev \ + libreadline-dev \ + libssl-dev \ + sudo \ + wget \ && rm -rf /var/lib/apt/lists/* WORKDIR /opt/ diff --git a/tests/dockerfiles/debian9/Dockerfile b/tests/dockerfiles/debian9/Dockerfile index 4c94901..4d43447 100644 --- a/tests/dockerfiles/debian9/Dockerfile +++ b/tests/dockerfiles/debian9/Dockerfile @@ -4,11 +4,11 @@ RUN useradd -ms /bin/bash user RUN apt-get update && \ apt-get install -y \ - curl \ - gpg \ - python \ - sudo \ - systemd \ + curl \ + gpg \ + python \ + sudo \ + systemd \ && rm -rf /var/lib/apt/lists/* CMD ["/bin/systemd"] diff --git a/tests/dockerfiles/ubuntu14/Dockerfile b/tests/dockerfiles/ubuntu14/Dockerfile index b1e04da..5cf3ba2 100644 --- a/tests/dockerfiles/ubuntu14/Dockerfile +++ b/tests/dockerfiles/ubuntu14/Dockerfile @@ -3,16 +3,16 @@ FROM ubuntu:14.04 RUN useradd -ms /bin/bash user RUN apt-get update && \ - apt-get install -y \ - curl \ - build-essential \ - libbz2-dev \ - libffi-dev \ - libncurses5-dev \ - libreadline-dev \ - libssl-dev \ - sudo \ - wget \ + apt-get install -y \ + curl \ + build-essential \ + libbz2-dev \ + libffi-dev \ + libncurses5-dev \ + libreadline-dev \ + libssl-dev \ + sudo \ + wget \ && rm -rf /var/lib/apt/lists/* WORKDIR /opt/ diff --git a/tests/dockerfiles/ubuntu16/Dockerfile b/tests/dockerfiles/ubuntu16/Dockerfile index 2b637e3..10e923d 100644 --- a/tests/dockerfiles/ubuntu16/Dockerfile +++ b/tests/dockerfiles/ubuntu16/Dockerfile @@ -4,9 +4,9 @@ RUN useradd -ms /bin/bash user RUN apt-get update && \ apt-get install -y \ - curl \ - python \ - sudo \ + curl \ + python \ + sudo \ && rm -rf /var/lib/apt/lists/* CMD ["/sbin/init"] diff --git a/tests/inventory b/tests/inventory index a48fe29..02faca2 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1,3 +1,9 @@ +[centos] +tests_centos6_1 ansible_connection=docker +tests_centos7_1 ansible_connection=docker [debian] tests_debian8_1 ansible_connection=docker tests_debian9_1 ansible_connection=docker +[ubuntu] +tests_ubuntu14_1 ansible_connection=docker +tests_ubuntu16_1 ansible_connection=docker From 16c7ea351a34753aa9b22ff06145b911569f5bd9 Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Tue, 19 Sep 2017 00:40:08 -0500 Subject: [PATCH 04/11] Escalate privileges to test single user installation --- tests/dockerfiles/centos6/Dockerfile | 5 +++-- tests/dockerfiles/centos7/Dockerfile | 5 +++-- tests/dockerfiles/debian8/Dockerfile | 9 +++++---- tests/dockerfiles/debian9/Dockerfile | 5 +++-- tests/dockerfiles/ubuntu14/Dockerfile | 5 +++-- tests/dockerfiles/ubuntu16/Dockerfile | 5 +++-- tests/test_user.yml | 1 + 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/tests/dockerfiles/centos6/Dockerfile b/tests/dockerfiles/centos6/Dockerfile index 1792c95..e067bbd 100644 --- a/tests/dockerfiles/centos6/Dockerfile +++ b/tests/dockerfiles/centos6/Dockerfile @@ -1,11 +1,12 @@ FROM centos:6 -RUN useradd -ms /bin/bash user - RUN yum update -y && \ yum install -y \ initscripts \ sudo \ && yum clean all +RUN useradd -ms /bin/bash user \ + && echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + CMD ["/sbin/init"] diff --git a/tests/dockerfiles/centos7/Dockerfile b/tests/dockerfiles/centos7/Dockerfile index 4cc0792..cdb6850 100644 --- a/tests/dockerfiles/centos7/Dockerfile +++ b/tests/dockerfiles/centos7/Dockerfile @@ -1,11 +1,12 @@ FROM centos:7 -RUN useradd -ms /bin/bash user - RUN yum update -y && \ yum install -y \ sudo \ which \ && yum clean all +RUN useradd -ms /bin/bash user \ + && echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + CMD ["/usr/sbin/init"] diff --git a/tests/dockerfiles/debian8/Dockerfile b/tests/dockerfiles/debian8/Dockerfile index 5ec183c..e2854bf 100644 --- a/tests/dockerfiles/debian8/Dockerfile +++ b/tests/dockerfiles/debian8/Dockerfile @@ -1,9 +1,7 @@ FROM debian:8 -RUN useradd -ms /bin/bash user - -RUN apt-get update && \ - apt-get install -y \ +RUN apt-get update \ + && apt-get install -y \ curl \ build-essential \ libbz2-dev \ @@ -19,4 +17,7 @@ WORKDIR /opt/ COPY build /opt/build RUN bash build +RUN useradd -ms /bin/bash user \ + && echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + CMD ["/sbin/init"] diff --git a/tests/dockerfiles/debian9/Dockerfile b/tests/dockerfiles/debian9/Dockerfile index 4d43447..c4c7312 100644 --- a/tests/dockerfiles/debian9/Dockerfile +++ b/tests/dockerfiles/debian9/Dockerfile @@ -1,7 +1,5 @@ FROM debian:9 -RUN useradd -ms /bin/bash user - RUN apt-get update && \ apt-get install -y \ curl \ @@ -11,4 +9,7 @@ RUN apt-get update && \ systemd \ && rm -rf /var/lib/apt/lists/* +RUN useradd -ms /bin/bash user \ + && echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + CMD ["/bin/systemd"] diff --git a/tests/dockerfiles/ubuntu14/Dockerfile b/tests/dockerfiles/ubuntu14/Dockerfile index 5cf3ba2..5121bfd 100644 --- a/tests/dockerfiles/ubuntu14/Dockerfile +++ b/tests/dockerfiles/ubuntu14/Dockerfile @@ -1,7 +1,5 @@ FROM ubuntu:14.04 -RUN useradd -ms /bin/bash user - RUN apt-get update && \ apt-get install -y \ curl \ @@ -19,4 +17,7 @@ WORKDIR /opt/ COPY build /opt/build RUN bash build +RUN useradd -ms /bin/bash user \ + && echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + CMD ["/sbin/init"] diff --git a/tests/dockerfiles/ubuntu16/Dockerfile b/tests/dockerfiles/ubuntu16/Dockerfile index 10e923d..c9b6004 100644 --- a/tests/dockerfiles/ubuntu16/Dockerfile +++ b/tests/dockerfiles/ubuntu16/Dockerfile @@ -1,7 +1,5 @@ FROM ubuntu:16.04 -RUN useradd -ms /bin/bash user - RUN apt-get update && \ apt-get install -y \ curl \ @@ -9,4 +7,7 @@ RUN apt-get update && \ sudo \ && rm -rf /var/lib/apt/lists/* +RUN useradd -ms /bin/bash user \ + && echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + CMD ["/sbin/init"] diff --git a/tests/test_user.yml b/tests/test_user.yml index e22bd70..05041f8 100644 --- a/tests/test_user.yml +++ b/tests/test_user.yml @@ -9,3 +9,4 @@ - 'ruby-2.3.1' roles: - role: rvm1-ansible + become: yes From 7190ce1864ce62b71e9dc2d5aeb1d6bf017adf1c Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Tue, 19 Sep 2017 15:09:22 -0500 Subject: [PATCH 05/11] Setup assertions, run them after the installation --- tests/post_tasks.yml | 35 +++++++++++++++++++++++++++++++ tests/{test_root.yml => root.yml} | 9 +++++++- tests/{test_user.yml => user.yml} | 7 +++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tests/post_tasks.yml rename tests/{test_root.yml => root.yml} (68%) rename tests/{test_user.yml => user.yml} (66%) diff --git a/tests/post_tasks.yml b/tests/post_tasks.yml new file mode 100644 index 0000000..750f8a1 --- /dev/null +++ b/tests/post_tasks.yml @@ -0,0 +1,35 @@ +--- +post_tasks: + - name: Check that ruby exists + command: ruby -v + register: check_ruby + - assert: + that: + - "check_ruby == 'ruby'" + - "check_ruby.rc == 0 " + msg: No ruby test pass + + - name: Check default ruby + shell: ~/.rvm/wrappers/default/ruby -v | cut -c1-10 + register: check_ruby_default + - assert: + that: + - "check_ruby_default.stdout == 'ruby 2.3.1'" + msg: Default ruby test pass + + - name: Check multiple rubies + command: ls ~/.rvm/rubies + register: check_ruby_multiple + - assert: + that: + - "ruby-2.2.5' in check_ruby_multiple.stdout" + - "ruby-2.3.1' in check_ruby_multiple.stdout" + msg: Multiple rubies test pass + + - name: Check bundler symlinked on system path + shell: ls ~/.rvm/wrappers/default/ |grep 'bundler' + register: check_ruby_bundler + - assert: + that: + - "check_ruby_bundler.stdout == 'bundler' " + msg: Bundler symlinked on system path test pass diff --git a/tests/test_root.yml b/tests/root.yml similarity index 68% rename from tests/test_root.yml rename to tests/root.yml index 789a0b0..32dc5b3 100644 --- a/tests/test_root.yml +++ b/tests/root.yml @@ -4,9 +4,16 @@ vars: rvm1_user: root rvm1_install_flags: '--auto-dotfiles' + rvm1_install_path: '/home/{{ rvm1_user }}/.rvm' rvm1_rubies: - 'ruby-2.2.5' - 'ruby-2.3.1' - rvm1_install_path: '/home/{{ rvm1_user }}/.rvm' roles: - role: rvm1-ansible + +# Asserts tasks +- hosts: all + gather_facts: false + tasks: + - name: Assert tasks + include: assertetions.yml diff --git a/tests/test_user.yml b/tests/user.yml similarity index 66% rename from tests/test_user.yml rename to tests/user.yml index 05041f8..dec998f 100644 --- a/tests/test_user.yml +++ b/tests/user.yml @@ -10,3 +10,10 @@ roles: - role: rvm1-ansible become: yes + +# Asserts tasks +- hosts: all + gather_facts: false + tasks: + - name: Assert tasks + include: assertions.yml From eaa1c80c1ecc2c0bc57dfc866643837ed334e891 Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Tue, 19 Sep 2017 15:28:57 -0500 Subject: [PATCH 06/11] Run docker-compose in travis --- .travis.yml | 65 ++++++++++++++------------------------------ tests/assertions.yml | 34 +++++++++++++++++++++++ tests/post_tasks.yml | 35 ------------------------ tests/root.yml | 2 +- 4 files changed, 56 insertions(+), 80 deletions(-) create mode 100644 tests/assertions.yml delete mode 100644 tests/post_tasks.yml diff --git a/.travis.yml b/.travis.yml index 91bc5e8..1208dca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,55 +1,32 @@ --- -language: 'python' -python: '2.7' +language: c +sudo: required -env: - - SITE_AND_INVENTORY='tests/test.yml -i tests/inventory' +services: + - docker + +cache: + directories: + - $HOME/docker before_install: - '__rvm_unload ; rm -rf ~/.rvm' - -install: - - 'pip install ansible==2.2.0' - - 'printf "[defaults]\nroles_path = ../" > ansible.cfg' + - if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi + - sudo rm /usr/local/bin/docker-compose + - curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > docker-compose + - chmod +x docker-compose + - sudo mv docker-compose /usr/local/bin + - sudo pip install ansible==2.2.0 script: + - cd tests + - docker-compose up -d + - ansible-playbook user.yml + +before_cache: - > - ruby -v - | grep -q 'ruby' - && (echo 'No ruby test: pass' && exit 1) - || (echo 'No ruby test: fail' && exit 0) - - 'ansible-playbook $SITE_AND_INVENTORY --syntax-check' - - 'ansible-playbook $SITE_AND_INVENTORY --connection=local -vvvv' - - > - ansible-playbook $SITE_AND_INVENTORY --connection=local - | grep -q 'changed=0.*failed=0' - && (echo 'Idempotence test: pass' && exit 0) - || (echo 'Idempotence test: fail' && exit 1) - - > - ~/.rvm/wrappers/default/ruby -v - | grep -q '2.3.1' - && (echo 'Default ruby test: pass' && exit 0) - || (echo 'Default ruby test: fail' && exit 1) - - > - ls ~/.rvm/rubies - | grep -q 'ruby-2.2.5' - && (echo 'Multiple rubies test: pass' && exit 0) - || (echo 'Multiple rubies test: fail' && exit 1) - - > - ansible-playbook $SITE_AND_INVENTORY --connection=local --extra-vars='rvm1_delete_ruby=ruby-2.2.5' - | grep -q 'ok=1.*failed=0' - && (echo 'Delete ruby test: pass' && exit 0) - || (echo 'Delete ruby test: fail' && exit 1) - - > - ls ~/.rvm/rubies/ | wc -l - | grep -q '2' - && (echo 'Really deleted ruby test: pass' && exit 0) - || (echo 'Really deleted ruby test: fail' && exit 1) - - > - ls ~/.rvm/wrappers/default/ - | grep -q 'bundler' - && (echo 'Bundler symlinked on system path test: pass' && exit 0) - || (echo 'Bundler symlinked on system path test: fail' && exit 1) + mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}' + | xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz' notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/tests/assertions.yml b/tests/assertions.yml new file mode 100644 index 0000000..f1944ce --- /dev/null +++ b/tests/assertions.yml @@ -0,0 +1,34 @@ +--- +- name: Check that ruby exists + command: ruby -v + register: check_ruby +- assert: + that: + - "{{ check_ruby.stdout }} == 'ruby'" + - "{{ check_ruby.rc }} == 0 " + msg: No ruby test pass + +- name: Check default ruby + shell: ~/.rvm/wrappers/default/ruby -v | cut -c1-10 + register: check_ruby_default +- assert: + that: + - "{{ check_ruby_default.stdout }} == 'ruby 2.3.1'" + msg: Default ruby test pass + +- name: Check multiple rubies + command: ls ~/.rvm/rubies + register: check_ruby_multiple +- assert: + that: + - "ruby-2.2.5' in {{ check_ruby_multiple.stdout }}" + - "ruby-2.3.1' in {{ check_ruby_multiple.stdout }}" + msg: Multiple rubies test pass + +- name: Check bundler symlinked on system path + shell: ls ~/.rvm/wrappers/default/ |grep 'bundler' + register: check_ruby_bundler +- assert: + that: + - "{{ check_ruby_bundler.stdout }} == 'bundler'" + msg: Bundler symlinked on system path test pass diff --git a/tests/post_tasks.yml b/tests/post_tasks.yml deleted file mode 100644 index 750f8a1..0000000 --- a/tests/post_tasks.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -post_tasks: - - name: Check that ruby exists - command: ruby -v - register: check_ruby - - assert: - that: - - "check_ruby == 'ruby'" - - "check_ruby.rc == 0 " - msg: No ruby test pass - - - name: Check default ruby - shell: ~/.rvm/wrappers/default/ruby -v | cut -c1-10 - register: check_ruby_default - - assert: - that: - - "check_ruby_default.stdout == 'ruby 2.3.1'" - msg: Default ruby test pass - - - name: Check multiple rubies - command: ls ~/.rvm/rubies - register: check_ruby_multiple - - assert: - that: - - "ruby-2.2.5' in check_ruby_multiple.stdout" - - "ruby-2.3.1' in check_ruby_multiple.stdout" - msg: Multiple rubies test pass - - - name: Check bundler symlinked on system path - shell: ls ~/.rvm/wrappers/default/ |grep 'bundler' - register: check_ruby_bundler - - assert: - that: - - "check_ruby_bundler.stdout == 'bundler' " - msg: Bundler symlinked on system path test pass diff --git a/tests/root.yml b/tests/root.yml index 32dc5b3..000587d 100644 --- a/tests/root.yml +++ b/tests/root.yml @@ -16,4 +16,4 @@ gather_facts: false tasks: - name: Assert tasks - include: assertetions.yml + include: assertions.yml From 0eb3277351bf5bdeda3c76c6f58546923d848a32 Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Tue, 19 Sep 2017 22:35:13 -0500 Subject: [PATCH 07/11] Fix asserts and run ansible by distros --- .travis.yml | 4 +++- tests/assertions.yml | 28 +++++++++++++++++----------- tests/user.yml | 2 ++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1208dca..74e8bcc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,9 @@ before_install: script: - cd tests - docker-compose up -d - - ansible-playbook user.yml + - ansible-playbook user.yml -l centos + - ansible-playbook user.yml -l debian + - ansible-playbook user.yml -l ubuntu before_cache: - > diff --git a/tests/assertions.yml b/tests/assertions.yml index f1944ce..8a21c77 100644 --- a/tests/assertions.yml +++ b/tests/assertions.yml @@ -1,34 +1,40 @@ --- - name: Check that ruby exists - command: ruby -v + shell: . $HOME/.bash_profile && ruby -v | cut -c1-4 + args: + executable: /bin/bash register: check_ruby + changed_when: false - assert: that: - - "{{ check_ruby.stdout }} == 'ruby'" - - "{{ check_ruby.rc }} == 0 " - msg: No ruby test pass + - check_ruby.stdout == 'ruby' + - check_ruby.rc == 0 + msg: No ruby installed - name: Check default ruby shell: ~/.rvm/wrappers/default/ruby -v | cut -c1-10 register: check_ruby_default + changed_when: false - assert: that: - - "{{ check_ruby_default.stdout }} == 'ruby 2.3.1'" - msg: Default ruby test pass + - check_ruby_default.stdout == 'ruby 2.3.1' + msg: No default ruby installed - name: Check multiple rubies command: ls ~/.rvm/rubies register: check_ruby_multiple + changed_when: false - assert: that: - - "ruby-2.2.5' in {{ check_ruby_multiple.stdout }}" - - "ruby-2.3.1' in {{ check_ruby_multiple.stdout }}" - msg: Multiple rubies test pass + - "'ruby-2.2.5' in check_ruby_multiple.stdout" + - "'ruby-2.3.1' in check_ruby_multiple.stdout" + msg: No multiple rubies installed - name: Check bundler symlinked on system path shell: ls ~/.rvm/wrappers/default/ |grep 'bundler' register: check_ruby_bundler + changed_when: false - assert: that: - - "{{ check_ruby_bundler.stdout }} == 'bundler'" - msg: Bundler symlinked on system path test pass + - check_ruby_bundler.stdout == 'bundler' + msg: No bundler symlinked on system path diff --git a/tests/user.yml b/tests/user.yml index dec998f..36dc315 100644 --- a/tests/user.yml +++ b/tests/user.yml @@ -1,6 +1,7 @@ --- - hosts: all gather_facts: false + remote_user: user vars: rvm1_user: user rvm1_install_path: '/home/{{ rvm1_user }}/.rvm' @@ -14,6 +15,7 @@ # Asserts tasks - hosts: all gather_facts: false + remote_user: user tasks: - name: Assert tasks include: assertions.yml From 9529c36744cdf93ae7129999c0f238c5304df71d Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Tue, 19 Sep 2017 23:19:25 -0500 Subject: [PATCH 08/11] Reduce the verbosity --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 74e8bcc..dad04cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,17 +10,17 @@ cache: - $HOME/docker before_install: - - '__rvm_unload ; rm -rf ~/.rvm' + - '__rvm_unload ; rm -rf ~/.rvm' > /dev/null 2>&1 - if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi - sudo rm /usr/local/bin/docker-compose - curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > docker-compose - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - - sudo pip install ansible==2.2.0 + - sudo pip install ansible==2.2.0 > /dev/null 2>&1 script: - cd tests - - docker-compose up -d + - docker-compose up -d > /dev/null 2>&1 - ansible-playbook user.yml -l centos - ansible-playbook user.yml -l debian - ansible-playbook user.yml -l ubuntu From 08b43de6798c4b7046d613b19599915a080c7bf8 Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Tue, 19 Sep 2017 23:20:31 -0500 Subject: [PATCH 09/11] Add CHANGELOG file --- .travis.yml | 2 +- CHANGELOG.md | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/.travis.yml b/.travis.yml index dad04cc..c772da7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: - $HOME/docker before_install: - - '__rvm_unload ; rm -rf ~/.rvm' > /dev/null 2>&1 + - '__rvm_unload > /dev/null 2>&1 ; rm -rf ~/.rvm' - if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi - sudo rm /usr/local/bin/docker-compose - curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > docker-compose diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5cc83d4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,113 @@ +# CHANGELOG +## MASTER + +### v2.0.1 + * Fix issue `src file does not exist` cause by testrb + +### v2.0.0 + * Bump ansible version to 2.2 + * Update readme + +### v1.3.9 + * Fix bugs + * Use a non-root user by default for the installation. + +### v1.3.8 + * Bump ruby version to 2.2.2 + * Fix Bundler symlinking on system path + * This fixes the location of the bundler pointing to the global ruby version + * Ensure a default value is supplied when detecting ruby, fixes #78 + * Update rvm installer path + * Update become method + * Ensure installed rubies and gems are owned correctly by rvm1_user + +### v1.3.7 + * Fix #40 by using a proper gem path + +### v1.3.6 + * Recent changes to rvm made bundler not get installed by default + * This patch installs bundler by default + +### v1.3.5 + * Ensure rvm1_user owns all rvm related files + * Allow passing in custom configuration options when installing ruby + +### v1.3.4 + * Change the default system wide install dir back to /usr/local/rvm + * Add the rvm1_user: 'root' default variable to let you set the rvm directory owner + * Update the README on why setting sudo: True is necessary + +### v1.3.3 + * Fix an incorrect condition which caused Ansible to error out + +### v1.3.2 + * Import the GPG signature every time rvm runs get [version]. + +### v1.3.1 + * Add gpg signature verification + +### v1.3.0 + * Remove the python-httplib2 dependency so it should work on CentOS 7 + * Change how versions are set, check the readme + * Always run rvm update unless you disable it by overwriting rvm1_rvm_check_for_updates + +### v1.2.0 + * Add CentOS/RHEL support + +### v1.1.1 + * Fix #7 and #8 by no longer chowning the user:group + * Symlink the ruby related bins to /usr/local/bin when doing a system wide install + * Remove the temp install dir, always use /tmp + * Expose the rvm install flags in a new default variable rvm1_install_flags + * Change the default system wide install dir to /usr/local/lib/rvm + * Update the readme to be much more clear and provide 3 examples of how to install rvm + * Update the travis test to test against ansible 1.7.1 instead of 1.6.2 + * Reformat all of the tasks to make them more readable and maintainable + +### v1.0.2 + * Force sudo as root when having to apt install python-httplib2, fixes #5. + +### v1.0.1 + * Install httplib2 if necessary (the ansible uri module depends on this) + + +### v1.0.0 + * Add ability to define 1 or more ruby versions + * Add ability to delete ruby versions + * Expose a few useful variables and paths + * Switch over from nickjj.ruby to rvm1-ansible + +### v0.1.9 + * Really fix the detect tasks so they are idempotent + +### v0.1.8 + * Fix the detect tasks so they are idempotent + +### v0.1.7 + * Simplify the default ruby selection tasks into a single task + +### v0.1.6 + * Fix the default ruby selection task so it works for both local and system installs + +### v0.1.5 + * Fix a bug where /etc/profile.d/rvm.sh would be sourced even if it did not exist + * Add the --default flag to the rvm use command + +### v0.1.4 + * Bump the default version of ruby to 2.1.2 + +### v0.1.3 + * Fix a bug with how the upgrade task was checking for rvm's existence + * Change how the role checks to determine if rvm is installed + +### v0.1.2 + * Allow you to specify a local path or url for the rvm installer script + * Allow you to specify a url or variable value for the latest rvm stable version number + +### v0.1.1 + * Auto upgrade rvm in an idempotent way but also allow you to turn this off + * Keep the rvm installer file on the server instead of deleting it in case http://get.rvm.io is down + * Toggle a variable to force update the installer + +### v0.1.0 + * View the readme to get a better understanding of what ansible-ruby does. From a43a3165a3c3f744a06b7eda506a2960d3cec671 Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Tue, 19 Sep 2017 23:47:45 -0500 Subject: [PATCH 10/11] Add ansible badge in the README --- CHANGELOG.md | 112 +++++++++++++++++++++++++-------------------------- README.md | 2 +- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cc83d4..4379746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,112 +2,112 @@ ## MASTER ### v2.0.1 - * Fix issue `src file does not exist` cause by testrb +* Fix issue `src file does not exist` cause by testrb ### v2.0.0 - * Bump ansible version to 2.2 - * Update readme +* Bump ansible version to 2.2 +* Update readme ### v1.3.9 - * Fix bugs - * Use a non-root user by default for the installation. +* Fix bugs +* Use a non-root user by default for the installation. ### v1.3.8 - * Bump ruby version to 2.2.2 - * Fix Bundler symlinking on system path - * This fixes the location of the bundler pointing to the global ruby version - * Ensure a default value is supplied when detecting ruby, fixes #78 - * Update rvm installer path - * Update become method - * Ensure installed rubies and gems are owned correctly by rvm1_user +* Bump ruby version to 2.2.2 +* Fix Bundler symlinking on system path +* This fixes the location of the bundler pointing to the global ruby version +* Ensure a default value is supplied when detecting ruby, fixes #78 +* Update rvm installer path +* Update become method +* Ensure installed rubies and gems are owned correctly by rvm1_user ### v1.3.7 - * Fix #40 by using a proper gem path +* Fix #40 by using a proper gem path ### v1.3.6 - * Recent changes to rvm made bundler not get installed by default - * This patch installs bundler by default +* Recent changes to rvm made bundler not get installed by default +* This patch installs bundler by default ### v1.3.5 - * Ensure rvm1_user owns all rvm related files - * Allow passing in custom configuration options when installing ruby +* Ensure rvm1_user owns all rvm related files +* Allow passing in custom configuration options when installing ruby ### v1.3.4 - * Change the default system wide install dir back to /usr/local/rvm - * Add the rvm1_user: 'root' default variable to let you set the rvm directory owner - * Update the README on why setting sudo: True is necessary +* Change the default system wide install dir back to /usr/local/rvm +* Add the rvm1_user: 'root' default variable to let you set the rvm directory owner +* Update the README on why setting sudo: True is necessary ### v1.3.3 - * Fix an incorrect condition which caused Ansible to error out +* Fix an incorrect condition which caused Ansible to error out ### v1.3.2 - * Import the GPG signature every time rvm runs get [version]. +* Import the GPG signature every time rvm runs get [version]. ### v1.3.1 - * Add gpg signature verification +* Add gpg signature verification ### v1.3.0 - * Remove the python-httplib2 dependency so it should work on CentOS 7 - * Change how versions are set, check the readme - * Always run rvm update unless you disable it by overwriting rvm1_rvm_check_for_updates +* Remove the python-httplib2 dependency so it should work on CentOS 7 +* Change how versions are set, check the readme +* Always run rvm update unless you disable it by overwriting rvm1_rvm_check_for_updates ### v1.2.0 - * Add CentOS/RHEL support +* Add CentOS/RHEL support ### v1.1.1 - * Fix #7 and #8 by no longer chowning the user:group - * Symlink the ruby related bins to /usr/local/bin when doing a system wide install - * Remove the temp install dir, always use /tmp - * Expose the rvm install flags in a new default variable rvm1_install_flags - * Change the default system wide install dir to /usr/local/lib/rvm - * Update the readme to be much more clear and provide 3 examples of how to install rvm - * Update the travis test to test against ansible 1.7.1 instead of 1.6.2 - * Reformat all of the tasks to make them more readable and maintainable +* Fix #7 and #8 by no longer chowning the user:group +* Symlink the ruby related bins to /usr/local/bin when doing a system wide install +* Remove the temp install dir, always use /tmp +* Expose the rvm install flags in a new default variable rvm1_install_flags +* Change the default system wide install dir to /usr/local/lib/rvm +* Update the readme to be much more clear and provide 3 examples of how to install rvm +* Update the travis test to test against ansible 1.7.1 instead of 1.6.2 +* Reformat all of the tasks to make them more readable and maintainable ### v1.0.2 - * Force sudo as root when having to apt install python-httplib2, fixes #5. +* Force sudo as root when having to apt install python-httplib2, fixes #5. ### v1.0.1 - * Install httplib2 if necessary (the ansible uri module depends on this) +* Install httplib2 if necessary (the ansible uri module depends on this) ### v1.0.0 - * Add ability to define 1 or more ruby versions - * Add ability to delete ruby versions - * Expose a few useful variables and paths - * Switch over from nickjj.ruby to rvm1-ansible +* Add ability to define 1 or more ruby versions +* Add ability to delete ruby versions +* Expose a few useful variables and paths +* Switch over from nickjj.ruby to rvm1-ansible ### v0.1.9 - * Really fix the detect tasks so they are idempotent +* Really fix the detect tasks so they are idempotent ### v0.1.8 - * Fix the detect tasks so they are idempotent +* Fix the detect tasks so they are idempotent ### v0.1.7 - * Simplify the default ruby selection tasks into a single task +* Simplify the default ruby selection tasks into a single task ### v0.1.6 - * Fix the default ruby selection task so it works for both local and system installs +* Fix the default ruby selection task so it works for both local and system installs ### v0.1.5 - * Fix a bug where /etc/profile.d/rvm.sh would be sourced even if it did not exist - * Add the --default flag to the rvm use command +* Fix a bug where /etc/profile.d/rvm.sh would be sourced even if it did not exist +* Add the --default flag to the rvm use command ### v0.1.4 - * Bump the default version of ruby to 2.1.2 +* Bump the default version of ruby to 2.1.2 ### v0.1.3 - * Fix a bug with how the upgrade task was checking for rvm's existence - * Change how the role checks to determine if rvm is installed +* Fix a bug with how the upgrade task was checking for rvm's existence +* Change how the role checks to determine if rvm is installed ### v0.1.2 - * Allow you to specify a local path or url for the rvm installer script - * Allow you to specify a url or variable value for the latest rvm stable version number +* Allow you to specify a local path or url for the rvm installer script +* Allow you to specify a url or variable value for the latest rvm stable version number ### v0.1.1 - * Auto upgrade rvm in an idempotent way but also allow you to turn this off - * Keep the rvm installer file on the server instead of deleting it in case http://get.rvm.io is down - * Toggle a variable to force update the installer +* Auto upgrade rvm in an idempotent way but also allow you to turn this off +* Keep the rvm installer file on the server instead of deleting it in case http://get.rvm.io is down +* Toggle a variable to force update the installer ### v0.1.0 - * View the readme to get a better understanding of what ansible-ruby does. +* View the readme to get a better understanding of what ansible-ruby does. diff --git a/README.md b/README.md index 25509ed..1574e8e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## What is rvm1-ansible? [![Build Status](https://travis-ci.org/rvm/rvm1-ansible.svg?branch=master)](https://travis-ci.org/rvm/rvm1-ansible) +## What is rvm1-ansible? [![Build Status](https://travis-ci.org/rvm/rvm1-ansible.svg?branch=master)](https://travis-ci.org/rvm/rvm1-ansible) [![Ansible Role](https://img.shields.io/badge/role-rvm_io-red.svg)](https://galaxy.ansible.com/rvm_io/ruby/) It is an [Ansible](http://www.ansible.com/home) role to install and manage ruby versions using rvm. From 6b30ffd10a7c76fe2f8d031993882a90a060eec1 Mon Sep 17 00:00:00 2001 From: Paul Montero Date: Wed, 20 Sep 2017 11:16:50 -0500 Subject: [PATCH 11/11] Small tweaks for travis --- .travis.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c772da7..6257e4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,28 @@ --- -language: c +language: generic + sudo: required +env: + DOCKER_COMPOSE_VERSION: 1.16.1 + services: - - docker + - docker cache: + pip: true directories: - $HOME/docker before_install: - - '__rvm_unload > /dev/null 2>&1 ; rm -rf ~/.rvm' - if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > docker-compose + - curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > docker-compose - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - - sudo pip install ansible==2.2.0 > /dev/null 2>&1 + +install: + - sudo pip install ansible==2.2.2 > /dev/null 2>&1 script: - cd tests