diff --git a/.travis.yml b/.travis.yml index 9081132..c783110 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -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/ diff --git a/tests/inventory b/tests/inventory index d18580b..2302eda 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1 +1 @@ -localhost \ No newline at end of file +localhost ansible_connection=local diff --git a/tests/requirements.yml b/tests/requirements.yml new file mode 100644 index 0000000..b230534 --- /dev/null +++ b/tests/requirements.yml @@ -0,0 +1,3 @@ +--- +- src: https://github.com/gantsign/ansible-role-java/archive/1.1.0.tar.gz + name: gantsign.java diff --git a/tests/test.yml b/tests/test.yml index 660c8fe..4364c4c 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -2,4 +2,12 @@ - hosts: localhost remote_user: root roles: - - ansible-role-intellij \ No newline at end of file + - 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