-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
37 lines (28 loc) · 1.37 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
sudo: required
env:
- distribution: ubuntu
version: 14.04
init: /sbin/init
run_opts: ""
services:
- docker
before_install:
# Pull container
- 'sudo docker pull ${distribution}:${version}'
# Build the image from the specified dockerfile in the docker folder
- 'sudo docker build --rm=true --file=docker/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible docker'
script:
- container_id=$(mktemp)
# Run container in detached state and mount the current directory to /bika
- 'sudo docker run --detach --volume="${PWD}":/bika:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"'
# Install Ansible requirements
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-galaxy install -r /bika/requirements.yml'
# Ansible syntax check of `test.yml`
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /bika/test.yml --syntax-check'
# XXX: The playbook runs correctly, but does not return a value anymore
# No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
# Test Bika Role
# - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /bika/test.yml --skip-tags bika-security'
# Clean up
# - 'sudo docker stop "$(cat ${container_id})"'