Skip to content

Commit

Permalink
Test running Ansible Role
Browse files Browse the repository at this point in the history
Check IntelliJ is installed and configured.
  • Loading branch information
freemanjp committed Aug 14, 2016
1 parent 7113c42 commit 28d4a88
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
39 changes: 36 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
language: python
python: "2.7"

# Use the new container infrastructure
sudo: false
# Require the standard build environment
sudo: required

# Require Ubuntu 14.04
dist: trusty

# Install ansible
addons:
Expand All @@ -13,14 +16,44 @@ addons:

install:
# Install ansible
- pip install ansible
- sudo pip install ansible

# Check ansible version
- ansible --version

# Update apt
- sudo apt-get -qq update

# Setup test_usr
- sudo useradd --home /home/test_usr test_usr

script:
# Install Ansible roles
- sudo ansible-galaxy install -r tests/requirements.yml

# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check

# Run the playbook with ansible-playbook
- sudo ansible-playbook tests/test.yml -i tests/inventory

# Check the IntelliJ is installed
- readlink -f $(which idea)

# Check the IntelliJ is configued
- ls -la /home/test_usr

- 'find /home/test_usr | grep --color=never -E ".*/\\.IdeaIC[0-9]+\\.[0-9]/config/disabled_plugins.txt"'
- 'plugin_config=$(find /home/test_usr | grep --color=never -E ".*/\\.IdeaIC[0-9]+\\.[0-9]/config/disabled_plugins.txt")'
- 'grep --color=never "org.jetbrains.plugins.gradle" "$plugin_config"'

- 'find /home/test_usr | grep --color=never -E ".*/\\.IdeaIC[0-9]+\\.[0-9]/config/options/jdk.table.xml"'
- 'jdk_config=$(find /home/test_usr | grep --color=never -E ".*/\\.IdeaIC[0-9]+\\.[0-9]/config/options/jdk.table.xml")'
- 'grep --color=never "/opt/java/jdk1.8.0_102" "$jdk_config"'

- 'find /home/test_usr | grep --color=never -E ".*/\\.IdeaIC[0-9]+\\.[0-9]/config/options/project.default.xml"'
- 'project_config=$(find /home/test_usr | grep --color=never -E ".*/\\.IdeaIC[0-9]+\\.[0-9]/config/options/project.default.xml")'
- 'grep --color=never "/test/maven/home" "$project_config"'

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
2 changes: 1 addition & 1 deletion tests/inventory
Original file line number Diff line number Diff line change
@@ -1 +1 @@
localhost
localhost ansible_connection=local
3 changes: 3 additions & 0 deletions tests/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- src: https://github.com/gantsign/ansible-role-java/archive/1.1.0.tar.gz
name: gantsign.java
10 changes: 9 additions & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@
- hosts: localhost
remote_user: root
roles:
- ansible-role-intellij
- role: gantsign.java
java_version: 8u102
- role: ansible-role-intellij
intellij_default_jdk_home: "/opt/java/jdk1.8.0_102"
intellij_default_maven_home: "/test/maven/home"
users:
- username: test_usr
intellij_disabled_plugins:
- org.jetbrains.plugins.gradle

0 comments on commit 28d4a88

Please sign in to comment.