-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
executable file
·42 lines (31 loc) · 1.1 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
38
39
40
41
42
---
# Need sudo for some Docker commands.
sudo: required
env:
# Add a list of OS'es to be tested on.
- distro: ubuntu2004
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: debian10.4 # buster
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
# - distro: OpenSUSE
# Tell Travis to start Docker when it brings up an environment.
services:
- docker
before_install:
# Pull the image from Docker Hub for the OS under test.
script:
# Start the container from the image and perform tests.
notifications:
# Notify Ansible Galaxy when a role builds successfully.
before_install:
# Pull container from Docker Hub.
- 'docker pull ansible/ansible'
script:
# Create a random file to store the container ID.
- container_id=$(mktemp)
# Run container detached, with our role mounted inside.
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} docker push svaksha/docker:latest "${init}" > "${container_id}"'
# TODO - Test the Ansible role.
...