Set docker-compose and run test playbook
This commit is contained in:
21
tests/dockerfiles/debian8/Dockerfile
Normal file
21
tests/dockerfiles/debian8/Dockerfile
Normal 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"]
|
||||
42
tests/dockerfiles/debian8/build
Normal file
42
tests/dockerfiles/debian8/build
Normal 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
|
||||
Reference in New Issue
Block a user