Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build shell test #49

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@

services:
- docker

language: bash

before_install:
- git config --global user.email "[email protected]"
- git config --global user.name "Your Name"
- git config --global user.email "[email protected]"
- git config --global user.name "Awslabs"

matrix:
include:
- env: GIT_VER=1.9.0 BASH_VER=3.0 DOCKER_BUILD_IMAGE=ubuntu:14.04
- env: GIT_VER=2.0.0 BASH_VER=3.0 DOCKER_BUILD_IMAGE=ubuntu:14.04
- env: GIT_VER=1.9.0 BASH_VER=4.0 DOCKER_BUILD_IMAGE=ubuntu:14.04
- env: GIT_VER=2.0.0 BASH_VER=4.0 DOCKER_BUILD_IMAGE=ubuntu:14.04
- env: GIT_VER=1.9.0 BASH_VER=3.0 DOCKER_BUILD_IMAGE=centos:centos7
- env: GIT_VER=2.0.0 BASH_VER=3.0 DOCKER_BUILD_IMAGE=centos:centos7
- env: GIT_VER=1.9.0 BASH_VER=4.0 DOCKER_BUILD_IMAGE=centos:centos7
- env: GIT_VER=2.0.0 BASH_VER=4.0 DOCKER_BUILD_IMAGE=centos:centos7
allow_failures:
- env: GIT_VER=1.9.0 BASH_VER=3.0 DOCKER_BUILD_IMAGE=ubuntu:14.04
- env: GIT_VER=2.0.0 BASH_VER=3.0 DOCKER_BUILD_IMAGE=ubuntu:14.04
- env: GIT_VER=1.9.0 BASH_VER=3.0 DOCKER_BUILD_IMAGE=centos:centos7
- env: GIT_VER=2.0.0 BASH_VER=3.0 DOCKER_BUILD_IMAGE=centos:centos7
fast_finish: true

script:
- make test
- docker run -it -v $PWD/docker-run.sh:/run.sh -e "GIT_VER=$GIT_VER" -e "BASH_VER=$BASH_VER" $DOCKER_BUILD_IMAGE /run.sh
53 changes: 53 additions & 0 deletions docker-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env bash

set -e

if [ -f /etc/debian_version ]; then
echo "Updating apt-get"
apt-get -qq -y update
echo "Installing gcc wget make"
apt-get -y install gcc wget make > /dev/null
echo "Installing dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev"
apt-get -y install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev > /dev/null

elif [ -f /etc/redhat-release ]; then
echo "Updating yum"
yum -q -y update
echo "Installing make gcc wget epel-release dnf"
yum -y install make gcc wget epel-release > /dev/null
yum -y install dnf > /dev/null
echo "Installing dh-autoreconf curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel"
dnf -y install dh-autoreconf curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel > /dev/null
ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
fi

# Install git from source
echo "Downloading git $GIT_VER and building from source"
wget https://www.kernel.org/pub/software/scm/git/git-$GIT_VER.tar.gz
tar -zxf git-$GIT_VER.tar.gz
cd git-$GIT_VER
make -s configure
./configure --prefix=/usr --quiet
make -s all
make -s install

# Install bash from source
echo "Downloading bash $BASH_VER and building from source"
cd /
wget https://ftp.gnu.org/gnu/bash/bash-$BASH_VER.tar.gz
tar -zxf bash-$BASH_VER.tar.gz
cd bash-$BASH_VER
./configure --prefix=/usr \
--bindir=/bin \
--without-bash-malloc \
--with-installed-readline \
--quiet
make -s
make -s install

# Clone git-secrets, install and run tests.
cd /
git clone https://github.com/awslabs/git-secrets.git
cd git-secrets
make -s install
make -s test