diff --git a/roles/quarkus/defaults/main.yml b/roles/quarkus/defaults/main.yml index 913517c..cf4e67e 100644 --- a/roles/quarkus/defaults/main.yml +++ b/roles/quarkus/defaults/main.yml @@ -4,6 +4,7 @@ quarkus_build_app: true quarkus_build_delete_workdir: false quarkus_build_shell_interpreter: /bin/bash quarkus_build_relative_path_to_deploy_dir: target/quarkus-app/ +quarkus_build_checkout_src_code: True quarkus_java_version: 17 quarkus_java_package_version: "java-{{ quarkus_java_version }}-openjdk-devel" diff --git a/roles/quarkus/tasks/build.yml b/roles/quarkus/tasks/build.yml index c36df01..06f3a49 100644 --- a/roles/quarkus/tasks/build.yml +++ b/roles/quarkus/tasks/build.yml @@ -45,6 +45,21 @@ repo: "{{ quarkus_app_repo_url }}" dest: "{{ quarkus_app_workdir }}" version: "{{ app_tag | default(omit) }}" + when: + - quarkus_build_checkout_src_code is defined and quarkus_build_checkout_src_code + + - name: "Load metadata on source directory" + ansible.builtin.stat: + path: "{{ quarkus_app_workdir }}" + register: source_dir + + - name: "Ensure that source dir exists" + ansible.builtin.assert: + that: + - source_dir is defined and source_dir.stat is defined + - source_dir.stat.exists is defined and source_dir.stat.exists + quiet: True + fail_msg: "The root folder of the Quarkus project does not exits: {{ quarkus_app_workdir }}" - name: "Build the App using Maven using {{ quarkus_java_home }} as JAVA_HOME." become: "{{ quarkus_app_dir_requires_become }}"