diff --git a/.travis.yml b/.travis.yml index 2593798..1527c81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ +services: + - docker + language: bash before_install: @@ -6,3 +9,11 @@ before_install: script: - make test +- docker run -it -v $PWD/docker-run.sh:/run.sh -e 'GIT_VER=1:2.7.4-0ubuntu1' -e 'BASH_VER=4.0' ubuntu /run.sh +- docker run -it -v $PWD/docker-run.sh:/run.sh -e 'GIT_VER=1:2.7.4-0ubuntu1' -e 'BASH_VER=4.0' ubuntu:14.04 /run.sh +- docker run -it -v $PWD/docker-run.sh:/run.sh -e 'BASH_VER=4.0' centos /run.sh + +after_script: +- docker run -it -v $PWD/docker-run.sh:/run.sh -e 'GIT_VER=1:2.7.4-0ubuntu1' -e 'BASH_VER=3.0' ubuntu /run.sh +- docker run -it -v $PWD/docker-run.sh:/run.sh -e 'GIT_VER=1:2.7.4-0ubuntu1' -e 'BASH_VER=3.0' ubuntu:14.04 /run.sh +- docker run -it -v $PWD/docker-run.sh:/run.sh -e 'BASH_VER=4.0' centos /run.sh diff --git a/docker-run.sh b/docker-run.sh new file mode 100755 index 0000000..0d7bdf8 --- /dev/null +++ b/docker-run.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -e + +if [ -f /etc/debian_version ]; then + apt-get -y update + apt-get -y install gcc wget + apt-get -y install make git=$GIT_VER +elif [ -f /etc/redhat-release ]; then + yum -y update + yum -y install make git gcc wget +fi + +wget https://ftp.gnu.org/gnu/bash/bash-$BASH_VER.tar.gz +tar -xvf bash* +cd bash-$BASH_VER +./configure --prefix=/usr \ + --bindir=/bin \ + --without-bash-malloc \ + --with-installed-readline +make +make install + +# Clone git-secrets, install and run tests. +git clone https://github.com/awslabs/git-secrets.git +cd git-secrets +make install +make test