Skip to content

Commit a49b051

Browse files
authored
Merge pull request #141 from idealista/develop
Release 6.1.0
2 parents 549b169 + 2dea99f commit a49b051

26 files changed

Lines changed: 157 additions & 56 deletions

.ansible-lint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
---
22
rules:
33
line-length: disable
4+
exclude_paths:
5+
- molecule/adoptopenjdk/tests
6+
- molecule/corretto/tests
7+
- molecule/default/tests
8+

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ env:
1717
- secure: WuOSbycFJIECLpysMXvNOYckr004ufS10PoboOldE/7yJPtAwKE6KIVdHLNQ942j70+GU3y18/UErMyY0mjyZl9zzQRhvQKpyGuKniTCCIDgxydhMP/Ik3+DHslG3szfTmbjo1bJ2+uRFLOxTgY7pnxebJbW3i7AKSEpK9XQY0GzGhJzazqJJeylMsC/gTOQFza2clPe1so5b5CoedbK3/Ued82dlDgb/bqY5rlyYvx/qdbNRl5kVdH/YWLWR2xdl1WffL91Lbh/YtqgLAeZuJJsza6dHvjKlFAiVFMuWxX3GBYgcdmxnL+vzy9Ldp4FiFi1B+amSjCQsQ8HB3vJqCAhWBs1pvHE4xlM7Pxaoz+Zz5Iwnb0LwQvwu+ehitHBpHTmKG1s3wVVPAx0xArZuN5fsn9vW/HAyoVM3AkI6jOjlgTEYVMCJSr/+fLvGwjzuhYoHLQfI8R6S4A71xz6n6xU8LoLrbg9V6ypfyNSuEsBD/W+H9cE8cmqiJftMnExj0dQMXDGp0b6gpFLgPo4L5d5szPgcLGTpmwcyRTTGDymjS5veDxIhwVtUQif78PlwIJ/Ky+2M/qREnSkt8OcAtv8msqvfTGfiQIHsWu/kHsRFctVfidBmLTU6KRSxwXhe+br67HsBuYKp6aGtubYE0QGwM+gn5UnIzAy6+5OmTo=
1818
- secure: jnMLyXO4BXHo5OWGDsgtTnKBoiV+EG5Qd7w+a0RfkJu/SeqW/pm7NOnGqWDxKUdf9UREtKvCO26ZdciC2DwmjOVsSH5KVnvS7fr2QvPalHNJhi8IHkSOi5BP4DUIFlJowBKCGMTftNUJCiZq5tq8GnnwR9eaQg0WqhqcSmRA/dIyN4MycayGhqt/+9gaTiOaiKrun7esAUnizszXOj8P0QBLxjAiXIfDmwUfe6z7vHRaf96L/T5tpDcRd00jxm+QYlsN8zIxYK5CguPwl/ip2jRAdkq2KA8MT5tL7qaqkqAKzzaetHKbSigzuzER8Wua5Qc3JZajI9YMayvJSrow3fXDmGg+T4XYJgRe87HtIO3IwHclvtfsYgrD1kYhLm+jo2czm8uQIKdQZqVkZ8lJxhV24yZ76Xa0ysEzmHXbV2HHmNYud2Kuh8CYPA+M9yB8icwoc58IqOOfj7/N8Siv5oypSuWmEHZdkhPVkPBY4Qq7aDMGy4/Uzy+yu4V++6oJrXZMAKKlDnuMayZylEaN+CLjZnDFDjusYDkTZRoNo1Bt5EiEb0AZQ19caVW0kRD0rseRa/Af/DYJswTo6AyXs4Tk2B4Mm/0XYGhku4QKZw6In3/FxTHxF16y9GZMv1T/0xRXpkmFYYHJE/4vhhsN0shTRNe+9b+tc/zvd5a3/3g=
1919
jobs:
20+
# openjdk
2021
- DOCKER_IMAGE_BASE=debian:stretch-slim DOCKER_TAG_TO_PUBLISH=8-stretch-openjdk-headless
2122
- DOCKER_IMAGE_BASE=debian:stretch-slim JDK_MAJOR=8 JDK_VERSION=8u265-b01-0+deb9u1 DOCKER_TAG_TO_PUBLISH=8u265-stretch-openjdk-headless
2223
- DOCKER_IMAGE_BASE=debian:stretch-slim JDK_MAJOR=11 JDK_VERSION=11.0.6+10-1~bpo9+1 DOCKER_TAG_TO_PUBLISH=11.0.6-stretch-openjdk-headless
@@ -33,8 +34,14 @@ env:
3334
- DOCKER_IMAGE_BASE=amd64/ubuntu:focal JDK_MAJOR=8 JDK_VERSION=8u265-b01-0ubuntu2~20.04 DOCKER_TAG_TO_PUBLISH=8u265-focal-openjdk-headless
3435
- DOCKER_IMAGE_BASE=centos:7 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos7-openjdk-headless
3536
- DOCKER_IMAGE_BASE=centos:8 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos8-openjdk-headless
37+
# adoptopenjdk
38+
- DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265-b01-3 DOCKER_TAG_TO_PUBLISH=8u265-buster-adoptopenjdk-headless
39+
- DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265_b01 DOCKER_TAG_TO_PUBLISH=8u265-centos8-adoptopenjdk-headless
40+
# corretto
41+
- DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.265.01-1 DOCKER_TAG_TO_PUBLISH=8u265-buster-corretto-headless
42+
- DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1.8.0_265.b01 DOCKER_TAG_TO_PUBLISH=8u265-centos8-corretto-headless
3643
script:
37-
- pipenv run molecule test
44+
- pipenv run molecule test --scenario-name=${JDK_VENDOR:-default}
3845
notifications:
3946
webhooks:
4047
- https://galaxy.ansible.com/api/v1/notifications/

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch
44

55
## [Unreleased](https://github.com/idealista/java_role/tree/develop)
66

7+
8+
## [6.1.0](https://github.com/idealista/java_role/tree/6.1.0) (2020-09-11)
9+
[Full Changelog](https://github.com/idealista/java_role/compare/6.0.0...6.1.0)
10+
### Added
11+
- *[#138](https://github.com/idealista/java_role/issues/138) Support for adoptopenjdk and corretto for buster/centos8* @vicsufer
12+
- *[#138](https://github.com/idealista/java_role/issues/138) Create images at dockerhub for adoptopenjdk and corretto* @vicsufer
13+
### Changed
14+
- *[#138](https://github.com/idealista/java_role/issues/138) Adapt adoptopenjdk and corretto test scenarios for future supported platforms.
15+
### Fixed
16+
- *[#63](https://github.com/idealista/java_role/issues/63) Solve Ansible Galaxy Warnings* @vicsufer
17+
718
## [6.0.0](https://github.com/idealista/java_role/tree/6.0.0) (2020-08-13)
819
[Full Changelog](https://github.com/idealista/java_role/compare/5.2.0...6.0.0)
920
### Changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ We publish every role version as a Docker image in Docker Hub: https://hub.docke
8080
You can pull our images by executing:
8181
8282
```bash
83-
docker pull idealista/jdk:${JDK_VERSION}-${DOCKER_IMAGE_BASE}-(openjdk-headless)
83+
docker pull idealista/jdk:${JDK_VERSION}-${DOCKER_IMAGE_BASE}-${JDK_VENDOR}headless)
8484
```
8585

8686
`JDK_VERSION:` Preferred JDK version.
8787
`DOCKER_IMAGE`: Currently supporting: `stretch`/`buster` to select between Debian versions, `xenial`/`bionic`/`focal` to select between Ubuntu versions, and `7`/`8` to select a CentOS version.
88+
`JDK_VENDOR`: Currently supporting `openjdk`/ `adoptopenjdk`/`corretto`
8889

8990
For instance:
9091

@@ -122,13 +123,14 @@ CentOS 7 | `11` (default)
122123
CentOS 8 | `1.8.0`
123124
CentOS 8 | `11` (default)
124125

125-
Other OpenJDK implementations out of GNU/Linux distributions streams are not officially supported, but it's easy use this role too adding extra repositories (see group vars in AdoptOpenJDK and Corretto molecule tests).
126+
Other OpenJDK implementations out of GNU/Linux distributions streams are not officially supported, but it's easy use this role too adding extra repositories (see vars/ in AdoptOpenJDK and Corretto directories).
126127
## Testing
127128

128129
```sh
129130
$ pipenv sync
130-
$ DOCKER_IMAGE_BASE=(debian:stretch-slim|debian:buster-slim|amd64/ubuntu:xenial|amd64/ubuntu:bionic|amd64/ubuntu:focal|centos:7|centos:8) JDK_MAJOR=(`java_open_jdk_version_major` see [.travis.yml](.travis.yml) file to check supported versions) JDK_VERSION=(`java_open_jdk_version` see [.travis.yml](.travis.yml) file to check supported versions) pipenv run molecule test
131+
$ DOCKER_IMAGE_BASE=(debian:stretch-slim|debian:buster-slim|amd64/ubuntu:xenial|amd64/ubuntu:bionic|amd64/ubuntu:focal|centos:7|centos:8) JDK_VENDOR=(`java_jdk_version` openjdk|adoptopenjdk|corretto) JDK_MAJOR=(`java_open_jdk_version_major` see [.travis.yml](.travis.yml) file to check supported versions) JDK_VERSION=(`java_open_jdk_version` see [.travis.yml](.travis.yml) file to check supported versions) pipenv run molecule test
131132
```
133+
**Note:** JDK_VENDOR is an optional parameter, if not defined this role will use openjdk.
132134
**Note:** JDK_VERSION is an optional parameter, if not defined this role will install the latest available package for the selected Java major release.
133135
**Note:** debian9 (Debian Stretch) will be used as default linux distro if none is provided.
134136

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
---
2+
java_jdk_vendor: openjdk
3+
24
java_open_jdk_apt_extra_packages: []
35
java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }}

molecule/adoptopenjdk/group_vars/openjdk/main.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

molecule/adoptopenjdk/molecule.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ platforms:
1717
provisioner:
1818
name: ansible
1919
inventory:
20-
links:
21-
group_vars: ./group_vars
20+
group_vars:
21+
openjdk:
22+
java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }}
23+
java_jdk_vendor: adoptopenjdk
24+
java_open_jdk_version: ${JDK_VERSION}
25+
java_open_jdk_version_major: ${JDK_MAJOR}
26+
2227
scenario:
2328
name: adoptopenjdk
2429
verifier:

molecule/adoptopenjdk/verify.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,29 @@
2323
molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}"
2424

2525
tasks:
26+
- name: Set JDK Vendor
27+
set_fact:
28+
java_jdk_vendor: adoptopenjdk
29+
30+
- name: Gather OS specific variables
31+
include_vars: "../../vars/{{ java_jdk_vendor }}/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
32+
# Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406)
33+
# Allowing to 'override' variables that are defined using include_vars
34+
35+
- name: Setting OS specific variables
36+
set_fact:
37+
java_open_jdk_version: "{{ java_open_jdk_version if java_open_jdk_version is defined and java_open_jdk_version is not sameas None }}"
38+
java_open_jdk_version_major: "{{ java_open_jdk_version_major if java_open_jdk_version_major is defined and java_open_jdk_version_major is not sameas None and java_open_jdk_version_major else __java_open_jdk_version_major }}" # noqa 204
39+
40+
- name: Setting OS specific variables (II)
41+
set_fact:
42+
java_open_jdk_home_dir: "{{ java_open_jdk_home_dir if java_open_jdk_home_dir is defined and java_open_jdk_home_dir is not sameas None and java_open_jdk_home_dir else __java_open_jdk_home_dir }}" # noqa 204
43+
java_open_jdk_package: "{{ java_open_jdk_package if java_open_jdk_package is defined and java_open_jdk_package is not sameas None and java_open_jdk_package else __java_open_jdk_package }}" # noqa 204
44+
45+
- name: Setting specific variables
46+
set_fact:
47+
java_home: "{{ java_open_jdk_home }}"
48+
2649
- name: Download and install goss
2750
get_url:
2851
url: "{{ goss_url }}"
@@ -39,12 +62,14 @@
3962
- name: Register test files
4063
shell: "ls {{ goss_test_directory }}/test_*.yml"
4164
register: test_files
65+
changed_when: false
4266

4367
- name: Execute Goss tests
4468
command: "goss -g {{ item }} validate --format {{ goss_format }}"
4569
register: test_results
4670
with_items: "{{ test_files.stdout_lines }}"
4771
ignore_errors: true
72+
changed_when: false
4873

4974
- name: Display details about the goss results
5075
debug:

molecule/corretto/group_vars/openjdk/main.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

molecule/corretto/molecule.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ platforms:
1717
provisioner:
1818
name: ansible
1919
inventory:
20-
links:
21-
group_vars: ./group_vars
20+
group_vars:
21+
openjdk:
22+
java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }}
23+
java_jdk_vendor: corretto
24+
java_open_jdk_version: ${JDK_VERSION}
25+
java_open_jdk_version_major: ${JDK_MAJOR}
26+
2227
scenario:
2328
name: corretto
2429
verifier:

0 commit comments

Comments
 (0)