Set docker-compose and run test playbook
This commit is contained in:
3
tests/ansible.cfg
Normal file
3
tests/ansible.cfg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[defaults]
|
||||||
|
inventory = inventory
|
||||||
|
roles_path = ../../
|
||||||
6
tests/docker-compose.yml
Normal file
6
tests/docker-compose.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
debian8:
|
||||||
|
build: ./dockerfiles/debian8
|
||||||
|
cap_add:
|
||||||
|
- ALL
|
||||||
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
|
||||||
@@ -1 +1,2 @@
|
|||||||
localhost
|
[debian]
|
||||||
|
tests_debian8_1 ansible_connection=docker
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
- hosts: all
|
||||||
- hosts: localhost
|
gather_facts: false
|
||||||
remote_user: travis
|
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
rvm1_rubies:
|
rvm1_rubies:
|
||||||
- 'ruby-2.2.5'
|
- 'ruby-2.2.5'
|
||||||
- 'ruby-2.3.1'
|
- 'ruby-2.3.1'
|
||||||
rvm1_install_path: '/home/travis/.rvm'
|
rvm1_install_path: '/home/{{ rvm1_user }}/.rvm'
|
||||||
rvm1_user: travis
|
rvm1_install_flags: '--auto-dotfiles'
|
||||||
|
rvm1_user: root
|
||||||
roles:
|
roles:
|
||||||
- rvm1-ansible
|
- role: rvm1-ansible
|
||||||
|
|||||||
Reference in New Issue
Block a user