-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from lossos/travis-development
Add a working travis config
- Loading branch information
Showing
15 changed files
with
286 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
exclude_paths: [] | ||
parseable: true | ||
quiet: true | ||
skip_list: [305] | ||
use_default_rules: true | ||
verbosity: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,55 @@ | ||
--- | ||
sudo: required | ||
dist: trusty | ||
language: generic | ||
|
||
env: | ||
- > | ||
dist=debian | ||
ver=8 | ||
container_id=$(mktemp) | ||
init=/sbin/init | ||
run_opts="--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" | ||
EXTRA_VARS='{"role_name":"Rocket.Chat.Ansible","host_name":"localhost"}' | ||
VERBOSE='-vv' | ||
- > | ||
dist=centos | ||
ver=7 | ||
container_id=$(mktemp) | ||
init=/usr/lib/systemd/systemd | ||
run_opts="--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" | ||
EXTRA_VARS='{"role_name":"Rocket.Chat.Ansible","host_name":"localhost"}' | ||
VERBOSE='-vv' | ||
- > | ||
dist=ubuntu | ||
ver=14.04 | ||
container_id=$(mktemp) | ||
init=/sbin/init | ||
run_opts="" | ||
EXTRA_VARS='{"role_name":"Rocket.Chat.Ansible","host_name":"localhost"}' | ||
VERBOSE='-vv' | ||
- > | ||
dist=ubuntu | ||
ver=16.04 | ||
container_id=$(mktemp) | ||
init=/sbin/init | ||
run_opts="--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" | ||
EXTRA_VARS='{"role_name":"Rocket.Chat.Ansible","host_name":"localhost"}' | ||
VERBOSE='-vv' | ||
- > | ||
dist=ubuntu | ||
ver=18.04 | ||
container_id=$(mktemp) | ||
init=/sbin/init | ||
run_opts="--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" | ||
EXTRA_VARS='{"role_name":"Rocket.Chat.Ansible","host_name":"localhost"}' | ||
VERBOSE='-vv' | ||
services: | ||
- docker | ||
|
||
before_install: | ||
- sudo docker build --rm=true | ||
--file="tests/Dockerfile.${dist}-${ver}" | ||
--tag="${dist}:ansible" tests | ||
|
||
before_script: | ||
- sudo docker run --detach | ||
--volume="${PWD}:/etc/ansible/roles/Rocket.Chat.Ansible:ro" | ||
${run_opts} "${dist}:ansible" "${init}" > "${container_id}" | ||
|
||
script: | ||
- sudo docker exec --tty "$(cat ${container_id})" | ||
env TERM=xterm ansible-playbook | ||
/etc/ansible/roles/Rocket.Chat.Ansible/tests/provision.yml | ||
--extra-vars="$EXTRA_VARS" $VERBOSE --syntax-check | ||
|
||
- sudo docker exec --tty "$(cat ${container_id})" | ||
env TERM=xterm ansible-playbook | ||
/etc/ansible/roles/Rocket.Chat.Ansible/tests/provision.yml | ||
--extra-vars="$EXTRA_VARS" $VERBOSE | ||
|
||
notifications: | ||
webhooks: https://galaxy.ansible.com/api/v1/notifications/ | ||
--- | ||
os: linux | ||
dist: xenial | ||
|
||
env: | ||
- distribution: centos | ||
version: 7 | ||
|
||
- distribution: debian | ||
version: stretch | ||
|
||
# - distribution: debian | ||
# version: jessie | ||
|
||
- distribution: debian | ||
version: buster | ||
|
||
- distribution: ubuntu | ||
version: 14.04 | ||
|
||
- distribution: ubuntu | ||
version: 16.04 | ||
|
||
- distribution: ubuntu | ||
version: 18.04 | ||
|
||
# - distribution: ubuntu | ||
# version: 20.04 | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
- 'sudo docker pull ${distribution}:${version}' | ||
- 'sudo docker build --no-cache --rm --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' | ||
|
||
script: | ||
- container_id=$(mktemp) | ||
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/Rocket.Chat.Ansible:ro ${distribution}-${version}:ansible > "${container_id}"' | ||
|
||
# Verify Ansible is available in the container. | ||
- sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible --version | ||
|
||
# Verify Ansible Scripts | ||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/Rocket.Chat.Ansible/tests/travis.yml --syntax-check' | ||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/Rocket.Chat.Ansible/tests/travis.yml' | ||
# - > | ||
# sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/Rocket.Chat.Ansible/tests/travis.yml | ||
# | grep -q 'changed=0.*failed=0' | ||
# && (echo 'Idempotence test: pass' && exit 0) | ||
# || (echo 'Idempotence test: fail' && exit 1) | ||
- 'sudo docker rm -f "$(cat ${container_id})"' | ||
|
||
#notifications: | ||
# webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
extends: default | ||
rules: | ||
line-length: | ||
max: 120 | ||
level: warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ galaxy_info: | |
- bionic | ||
- name: Debian | ||
versions: | ||
- jessie | ||
- buster | ||
- stretch | ||
- buster | ||
galaxy_tags: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
FROM centos:7 | ||
# Install systemd -- See https://hub.docker.com/_/centos/ | ||
RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs | ||
RUN yum -y update; \ | ||
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | ||
rm -f /lib/systemd/system/multi-user.target.wants/*; \ | ||
rm -f /etc/systemd/system/*.wants/*; \ | ||
rm -f /lib/systemd/system/local-fs.target.wants/*; \ | ||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ | ||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ | ||
rm -f /lib/systemd/system/basic.target.wants/*; \ | ||
rm -f /lib/systemd/system/anaconda.target.wants/*; | ||
# Install Ansible | ||
RUN yum -y install epel-release | ||
RUN yum -y install git ansible sudo | ||
RUN yum clean all | ||
# Disable requiretty | ||
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers | ||
# Install Ansible inventory file | ||
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts | ||
VOLUME [ "/sys/fs/cgroup" ] | ||
CMD ["/usr/sbin/init"] | ||
FROM centos:7 | ||
# Install systemd -- See https://hub.docker.com/_/centos/ | ||
RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs | ||
RUN yum -y update; \ | ||
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | ||
rm -f /lib/systemd/system/multi-user.target.wants/*; \ | ||
rm -f /etc/systemd/system/*.wants/*; \ | ||
rm -f /lib/systemd/system/local-fs.target.wants/*; \ | ||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ | ||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ | ||
rm -f /lib/systemd/system/basic.target.wants/*; \ | ||
rm -f /lib/systemd/system/anaconda.target.wants/*; | ||
# Install Ansible | ||
RUN yum -y install epel-release | ||
RUN yum -y install git ansible sudo | ||
RUN yum clean all | ||
# Disable requiretty | ||
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers | ||
# Install Ansible inventory file | ||
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts | ||
VOLUME [ "/sys/fs/cgroup" ] | ||
CMD ["/usr/sbin/init"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM debian:buster | ||
|
||
ENV pip_packages "ansible cryptography" | ||
|
||
# Install dependencies. | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
sudo systemd systemd-sysv \ | ||
build-essential wget libffi-dev libssl-dev \ | ||
python3-pip python3-dev python3-setuptools python3-wheel \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -Rf /usr/share/doc && rm -Rf /usr/share/man \ | ||
&& apt-get clean | ||
|
||
# Install Ansible via pip. | ||
RUN pip3 install $pip_packages | ||
|
||
RUN mkdir -p /etc/ansible && echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts | ||
|
||
ENTRYPOINT ["/bin/systemd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM debian:jessie | ||
|
||
RUN apt-get update -y && apt-get install -y --no-install-recommends \ | ||
software-properties-common \ | ||
build-essential \ | ||
libffi-dev \ | ||
libssl-dev \ | ||
python-dev \ | ||
python-pip \ | ||
python-yaml \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip install cryptography --upgrade && pip install ansible | ||
|
||
RUN mkdir -p /etc/ansible && echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts | ||
|
||
ENTRYPOINT ["/sbin/init"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM debian:stretch | ||
|
||
RUN apt-get update -y && apt-get install -y --no-install-recommends \ | ||
software-properties-common \ | ||
build-essential \ | ||
libffi-dev \ | ||
libssl-dev \ | ||
python-dev \ | ||
python-pip \ | ||
python-yaml \ | ||
git \ | ||
systemd \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip install --upgrade setuptools && pip install ansible | ||
|
||
RUN mkdir -p /etc/ansible && echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts | ||
|
||
ENTRYPOINT ["/bin/systemd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# Dockerfile.ubuntu | ||
FROM ubuntu-upstart:14.04 | ||
# Install Ansible | ||
#RUN mv /sbin/initctl.distrib /sbin/initctl | ||
RUN apt-get update -y | ||
RUN apt-get install -y python-software-properties software-properties-common | ||
RUN add-apt-repository -y ppa:ansible/ansible | ||
RUN apt-get update -y | ||
RUN apt-get install -y ansible git-core | ||
# Install Ansible inventory file | ||
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts | ||
# Dockerfile.ubuntu | ||
FROM ubuntu-upstart:14.04 | ||
# Install Ansible | ||
#RUN mv /sbin/initctl.distrib /sbin/initctl | ||
RUN apt-get update -y | ||
RUN apt-get install -y python-software-properties software-properties-common | ||
RUN add-apt-repository -y ppa:ansible/ansible | ||
RUN apt-get update -y | ||
RUN apt-get install -y ansible git-core | ||
# Install Ansible inventory file | ||
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts |
Oops, something went wrong.