From 0d83ec024ec22975dcceb23f384e88d558d33445 Mon Sep 17 00:00:00 2001 From: Roberto Date: Mon, 11 Mar 2019 10:10:01 +0100 Subject: [PATCH] manage couchbase uberjar --- smartgears/accounting-service/tasks/main.yml | 44 ++++++++++++++++---- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/smartgears/accounting-service/tasks/main.yml b/smartgears/accounting-service/tasks/main.yml index 26db937e..0ac797cb 100644 --- a/smartgears/accounting-service/tasks/main.yml +++ b/smartgears/accounting-service/tasks/main.yml @@ -21,17 +21,47 @@ file: dest={{ smartgears_instance_path }}/webapps/{{ accounting_service_name }} state=absent when: accounting_download is changed - - name: Remove the accounting service library - shell: rm -fr {{ smartgears_instance_path }}/lib/{{ accounting_service_library_name }}-* +# - name: Remove the accounting service library +# shell: rm -fr {{ smartgears_instance_path }}/lib/{{ accounting_service_library_name }}-* +# when: accounting_download is changed + +# - name: Remove the accounting couchbase library if present +# shell: rm -fr {{ smartgears_instance_path }}/lib/{{ accounting_couchbase_library_name }}-* +# when: accounting_download is changed + +# - name: Get the couchbase library +# maven_artifact: artifact_id={{ accounting_couchbase_library_name }} version={{ accounting_couchbase_library_version | default('latest') }} group_id={{ accounting_couchbase_library_group_id }} extension={{ accounting_couchbase_library_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ accounting_service_library_classifier }} dest={{ smartgears_instance_path }}/lib +# when: accounting_download is changed + + - name: Remove the accounting couchbase libraries if presents + shell: rm -fr {{ smartgears_instance_path }}/lib/couchbase when: accounting_download is changed - - name: Remove the accounting couchbase library if present - shell: rm -fr {{ smartgears_instance_path }}/lib/{{ accounting_couchbase_library_name }}-* + + - name: Create the couchbase directory inside tomcat/lib + file: dest={{ smartgears_instance_path }}/lib/couchbase state=directory + register: couchbase_create_dir + + - name: Get the couchbase uberjar library + maven_artifact: artifact_id={{ accounting_couchbase_library_name }} version={{ accounting_couchbase_library_version | default('latest') }} group_id={{ accounting_couchbase_library_group_id }} extension={{ accounting_couchbase_library_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ accounting_couchbase_library_classifier }} dest={{ smartgears_downloads_dir }}//{{ couchbase_uber_file }} when: accounting_download is changed - - name: Get the couchbase library - maven_artifact: artifact_id={{ accounting_couchbase_library_name }} version={{ accounting_couchbase_library_version | default('latest') }} group_id={{ accounting_couchbase_library_group_id }} extension={{ accounting_couchbase_library_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ accounting_service_library_classifier }} dest={{ smartgears_instance_path }}/lib - when: accounting_download is changed + - name: Unarchive the couchbase uber jar + unarchive: src={{ smartgears_downloads_dir }}/{{ couchbase_uber_file }} dest={{ smartgears_instance_path }}/lib/couchbase/ copy=no + when: couchbase_create_dir is changed + notify: Restart smartgears + + - name: Download the couchbase jar file + maven_artifact: artifact_id={{ accounting_couchbase_library_name }} version={{ accounting_couchbase_library_version }} group_id={{ accounting_couchbase_library_group_id }} extension={{ accounting_couchbase_library_extension }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_instance_path }}/lib/couchbase/ keep_name=yes + notify: Restart smartgears + + - name: Remove the couchbase uber jar org and META-INF directories + file: dest={{ smartgears_instance_path }}/lib/couchbase/{{ item }} state=absent + with_items: + - org + - 'META-INF' + notify: Restart smartgears + - name: Copy the accounting_service war file to the destination place copy: src={{ smartgears_downloads_dir }}/{{ accounting_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ accounting_service_name }}.{{ accounting_service_extension }} remote_src=yes force=yes