Skip to content

Commit

Permalink
Tests on different distros using docker
Browse files Browse the repository at this point in the history
  • Loading branch information
imshashank committed Jul 27, 2017
1 parent b10e08e commit c438eb4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
services:
- docker

language: bash

before_install:
Expand All @@ -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
28 changes: 28 additions & 0 deletions docker-run.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c438eb4

Please sign in to comment.