Radosław Piliszek 9b805c67f5 Switch the java library upload job to the proposed schema
Change-Id: I326b0cd1ba11bd373f5e5fa2b2311e1b44450e12
2023-10-19 13:41:24 +02:00

30 lines
941 B
YAML

- hosts: all
roles:
- install-jdk
- install-maven
tasks:
- name: Ensure .m2 directory exists
file:
path: "{{ ansible_env.HOME }}/.m2"
state: directory
- name: Template out settings.xml
template:
src: settings.xml.j2
dest: "{{ ansible_env.HOME }}/.m2/settings.xml"
vars:
username: "{{ nebulous_nexus_repository_credentials.username }}"
password: "{{ nebulous_nexus_repository_credentials.password }}"
# TODO: support more libraries from one repo
- name: Deploy the artifact to OSSRH
shell: |
mvn deploy -DskipTests
args:
chdir: "{{ library_path }}" # Pointing to the directory with pom.xml
vars:
library_path: "{{ zuul.project.src_dir }}/{{ java_libraries[0].context }}"
environment:
MAVEN_HOME: "/opt/apache-maven-3.8.8"
PATH: "{{ ansible_env.PATH }}:/opt/apache-maven-3.8.8/bin"