Skip to content
This repository has been archived by the owner on Oct 10, 2021. It is now read-only.

Commit

Permalink
Add CI Testing (#3)
Browse files Browse the repository at this point in the history
* Add testing to role

Testing is based on how geerlingguy test roles.

* Add fancy README badge.
  • Loading branch information
jonathangreen authored and dannylamb committed Feb 7, 2018
1 parent b98c3d3 commit 8ea7486
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tests/test.sh
*.retry
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
services: docker

env:
- distro: centos7
- distro: ubuntu1604

script:
# Download test shim.
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
- chmod +x ${PWD}/tests/test.sh

# Run tests.
- ${PWD}/tests/test.sh
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ansible Role: Grok
# Ansible Role: Grok [![Build Status](https://travis-ci.org/Islandora-Devops/ansible-role-grok.svg?branch=master)](https://travis-ci.org/Islandora-Devops/ansible-role-grok)

An Ansible role that installs [Grok](https://github.com/GrokImageCompression/grok) on:

Expand All @@ -21,14 +21,16 @@ grok_version_tag: v2.3.0

## Dependencies

* None
* Playbook requires the following applciations to be installed:
- git
- build-essential (gcc, g++, make)

## Example Playbook

- hosts: webservers
roles:
- { role: islandora.grok }
- islandora.grok

## License

MIT
MIT
2 changes: 2 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
- name: Install Grok dependencies (apt)
apt:
name: "{{ item }}"
update_cache: yes
cache_valid_time: 600
with_items:
- cmake
- libpng16-dev
Expand Down
26 changes: 26 additions & 0 deletions tests/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- hosts: all

pre_tasks:
- name: Install dependancies (apt)
apt:
update_cache: yes
cache_valid_time: 600
name: "{{ item }}"
with_items:
- git
- build-essential
when: ansible_os_family == 'Debian'

- name: Install dependancies (yum)
yum:
name: "{{ item }}"
with_items:
- git
- gcc
- gcc-c++
- make
when: ansible_os_family == 'RedHat'

roles:
- role_under_test

0 comments on commit 8ea7486

Please sign in to comment.