-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
12 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 |
---|---|---|
@@ -1,17 +1,8 @@ | ||
--- | ||
sudo: required | ||
dist: precise | ||
language: python | ||
python: 2.7.11 | ||
|
||
env: | ||
- SITE=test.yml | ||
|
||
install: | ||
- pip install ansible ansible-lint --upgrade | ||
- ansible --version | ||
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg" | ||
services: | ||
- docker | ||
|
||
script: | ||
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check" | ||
- "ansible-lint tests/$SITE" | ||
- docker build . |
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,26 @@ | ||
FROM debian:stretch | ||
MAINTAINER Laurent Arnoud <laurent@spkdev.net> | ||
|
||
ENV ROLE_NAME ansible-syncthing-debian | ||
ENV WORKDIR /build/${ROLE_NAME} | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
WORKDIR ${WORKDIR} | ||
RUN apt-get update -qq \ | ||
&& apt-get -y --no-install-recommends install ansible python-pip \ | ||
&& apt-get purge -y \ | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
RUN pip install ansible-lint | ||
ADD . ${WORKDIR} | ||
ADD . /etc/ansible/roles/${ROLE_NAME} | ||
ADD ./tests/inventory /etc/ansible/hosts | ||
|
||
RUN ansible-playbook -i $WORKDIR/tests/inventory $WORKDIR/tests/test.yml --syntax-check | ||
RUN ansible-lint $WORKDIR/tests/test.yml | ||
RUN ansible-playbook -i $WORKDIR/tests/inventory $WORKDIR/tests/test.yml --connection=local | ||
RUN ansible-playbook -i $WORKDIR/tests/inventory $WORKDIR/tests/test.yml --connection=local \ | ||
| grep -q 'changed=0.*failed=0' \ | ||
&& (echo 'Idempotence test: pass' && exit 0) \ | ||
|| (echo 'Idempotence test: fail' && exit 1) | ||
RUN syncthing -version |