Set docker-compose and run test playbook

This commit is contained in:
Paul Montero
2017-09-11 00:16:16 -05:00
parent 4f9f840cf6
commit 7b20b622b3
6 changed files with 80 additions and 9 deletions

View File

@@ -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"]

View File

@@ -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