Add roles for handling java libraries
With OpenJDK and Maven. Change-Id: I156d824bab7fdfbe121f5ed4c3a2453c4d7fe848 Depends-On: https://review.opendev.org/c/nebulous/library-template/+/898805
This commit is contained in:
parent
f5d27eb909
commit
f26b01d8e2
@ -1,2 +1,14 @@
|
||||
- hosts: all
|
||||
tasks: []
|
||||
roles:
|
||||
- install_jdk
|
||||
- maven
|
||||
tasks:
|
||||
- name: Build the project with Maven
|
||||
shell: mvn clean install -DskipTests
|
||||
args:
|
||||
chdir: "{{ project_path }}" # Pointing to the directory with pom.xml
|
||||
vars:
|
||||
project_path: "{{ zuul.project.src_dir }}/{{ java_library_path }}"
|
||||
environment:
|
||||
MAVEN_HOME: "/opt/apache-maven-3.8.8"
|
||||
PATH: "{{ ansible_env.PATH }}:/opt/apache-maven-3.8.8/bin"
|
||||
|
@ -1,2 +0,0 @@
|
||||
- hosts: all
|
||||
tasks: []
|
@ -1,2 +0,0 @@
|
||||
- hosts: all
|
||||
tasks: []
|
1
roles/install-jdk/defaults/main.yaml
Normal file
1
roles/install-jdk/defaults/main.yaml
Normal file
@ -0,0 +1 @@
|
||||
jdk_version: openjdk-17-jdk
|
7
roles/install-jdk/tasks/main.yaml
Normal file
7
roles/install-jdk/tasks/main.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
- name: Install OpenJDK
|
||||
apt:
|
||||
name: "{{ jdk_version }}"
|
||||
cache_valid_time: 3600
|
||||
state: present
|
||||
become: yes
|
||||
when: ansible_os_family == "Debian"
|
3
roles/install-maven/defaults/main.yaml
Normal file
3
roles/install-maven/defaults/main.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
maven_version: "3.8.8"
|
||||
maven_archive_name: "apache-maven-{{ maven_version }}-bin.tar.gz"
|
||||
maven_download_url: "https://downloads.apache.org/maven/maven-3/{{ maven_version }}/binaries/{{ maven_archive_name }}"
|
11
roles/install-maven/tasks/main.yaml
Normal file
11
roles/install-maven/tasks/main.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
- name: Download Maven
|
||||
get_url:
|
||||
url: "{{ maven_download_url }}"
|
||||
dest: "/tmp/{{ maven_archive_name }}"
|
||||
|
||||
- name: Extract Maven Archive
|
||||
unarchive:
|
||||
src: "/tmp/{{ maven_archive_name }}"
|
||||
dest: "/opt"
|
||||
remote_src: yes
|
||||
become: yes
|
@ -30,11 +30,3 @@
|
||||
- job:
|
||||
name: nebulous-build-java-libraries
|
||||
run: playbooks/java-libraries/build.yaml
|
||||
|
||||
- job:
|
||||
name: nebulous-upload-java-libraries
|
||||
run: playbooks/java-libraries/upload.yaml
|
||||
|
||||
- job:
|
||||
name: nebulous-promote-java-libraries
|
||||
run: playbooks/java-libraries/promote.yaml
|
||||
|
@ -2,7 +2,6 @@
|
||||
check:
|
||||
jobs:
|
||||
- nox-linters
|
||||
|
||||
# cross-testing with component-template
|
||||
- opendev-buildset-registry
|
||||
- nebulous-component-template-hadolint: &cross_test_component_template
|
||||
@ -15,7 +14,6 @@
|
||||
gate:
|
||||
jobs:
|
||||
- nox-linters
|
||||
|
||||
# cross-testing with component-template
|
||||
- opendev-buildset-registry
|
||||
- nebulous-component-template-hadolint: *cross_test_component_template
|
||||
|
Loading…
Reference in New Issue
Block a user