From abb4eae59ce230a6705ba726fb352e3997cf2bda Mon Sep 17 00:00:00 2001 From: mandeepdhiman123 Date: Mon, 7 Sep 2020 23:17:04 +0530 Subject: [PATCH] setup cronjob --- .../functional-test-setup/tasks/main.yml | 100 +++++++++--------- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/mosip-security-playbook/roles/functional-test-setup/tasks/main.yml b/mosip-security-playbook/roles/functional-test-setup/tasks/main.yml index 33520a9..f7fec99 100644 --- a/mosip-security-playbook/roles/functional-test-setup/tasks/main.yml +++ b/mosip-security-playbook/roles/functional-test-setup/tasks/main.yml @@ -19,64 +19,62 @@ register: check_for_rebuild when: testrig_folder.stat.exists == true -block: - - name: "Deleting old build" - file: - path: "{{ testrig_dir }}" - state: absent - # when: check_for_rebuild.user_input | bool +- name: "Deleting old build" + file: + path: "{{ testrig_dir }}" + state: absent + when: check_for_rebuild.user_input | bool - - name: Downloading upgraded build version - unarchive: - src: "https://github.com/mosip/mosip-functional-tests/archive/{{ testrig_version }}.zip" - dest: "{{ tools_dir }}" - remote_src: yes - # when: check_for_rebuild.user_input | bool +- name: Downloading upgraded build version + unarchive: + src: "https://github.com/mosip/mosip-functional-tests/archive/{{ testrig_version }}.zip" + dest: "{{ tools_dir }}" + remote_src: yes + when: check_for_rebuild.user_input | bool - - name: Bulding upgraded partner demo service for dependency - shell: "cd {{ testrig_dir }}/authentication-partnerdemo-service/ && mvn clean install" - # when: check_for_rebuild.user_input | bool +- name: Bulding upgraded partner demo service for dependency + shell: "cd {{ testrig_dir }}/authentication-partnerdemo-service/ && mvn clean install" + when: check_for_rebuild.user_input | bool - - name: Bulding upgraded test-rig - shell: "cd {{ testrig_dir }}/automationtests && mvn clean install" - # when: check_for_rebuild.user_input | bool +- name: Bulding upgraded test-rig + shell: "cd {{ testrig_dir }}/automationtests && mvn clean install" + when: check_for_rebuild.user_input | bool - - name: Copy jar file to test testrig directory - shell: "mv {{ testrig_dir }}/automationtests/target/*dependencies.jar {{ testrig_dir }}/automationtests/target/automationtests.jar" - # when: check_for_rebuild.user_input | bool +- name: Copy jar file to test testrig directory + shell: "mv {{ testrig_dir }}/automationtests/target/*dependencies.jar {{ testrig_dir }}/automationtests/target/automationtests.jar" + when: check_for_rebuild.user_input | bool - - name: Sceduling upgraded Cronjob for test-rig - cron: - name: "functional-test" - minute: "00" - hour: "02" - job: "cd {{ testrig_dir }}/automationtests/target/ && java -jar -Dmodules=all -Denv.user=qa -Denv.endpoint=https://qa.mosip.net -Denv.testLevel=smokeAndRegression automationtests.jar" -when: check_for_rebuild.user_input | bool +- name: Sceduling upgraded Cronjob for test-rig + cron: + name: "functional-test" + minute: "00" + hour: "02" + job: "cd {{ testrig_dir }}/automationtests/target/ && java -jar -Dmodules=all -Denv.user=qa -Denv.endpoint=https://qa.mosip.net -Denv.testLevel=smokeAndRegression automationtests.jar" + when: check_for_rebuild.user_input | bool -block: - - name: Download new version of Functional Test - unarchive: - src: "https://github.com/mosip/mosip-functional-tests/archive/{{ testrig_version }}.zip" - dest: "{{ tools_dir }}" - remote_src: yes - # when: testrig_folder.stat.exists == false +- name: Download new version of Functional Test + unarchive: + src: "https://github.com/mosip/mosip-functional-tests/archive/{{ testrig_version }}.zip" + dest: "{{ tools_dir }}" + remote_src: yes + when: testrig_folder.stat.exists == false - - name: Bulding new version of partner demo service for dependency - shell: "cd {{ testrig_dir }}/authentication-partnerdemo-service/ && mvn clean install" - # when: testrig_folder.stat.exists == false +- name: Bulding new version of partner demo service for dependency + shell: "cd {{ testrig_dir }}/authentication-partnerdemo-service/ && mvn clean install" + when: testrig_folder.stat.exists == false - - name: Bulding new version of test-rig - shell: "cd {{ testrig_dir }}/automationtests && mvn clean install" - # when: testrig_folder.stat.exists == false +- name: Bulding new version of test-rig + shell: "cd {{ testrig_dir }}/automationtests && mvn clean install" + when: testrig_folder.stat.exists == false - - name: Copy jar file to test testrig directory - shell: "mv {{ testrig_dir }}/automationtests/target/*dependencies.jar {{ testrig_dir }}/automationtests/target/automationtests.jar" - # when: testrig_folder.stat.exists == false +- name: Copy jar file to test testrig directory + shell: "mv {{ testrig_dir }}/automationtests/target/*dependencies.jar {{ testrig_dir }}/automationtests/target/automationtests.jar" + when: testrig_folder.stat.exists == false - - name: Sceduling Cronjob for test-rig - cron: - name: "functional-test" - minute: "00" - hour: "02" - job: "cd {{ testrig_dir }}/automationtests/target/ && java -jar -Dmodules=all -Denv.user=qa -Denv.endpoint=https://qa.mosip.net -Denv.testLevel=smokeAndRegression automationtests.jar" -when: testrig_folder.stat.exists == false \ No newline at end of file +- name: Sceduling Cronjob for test-rig + cron: + name: "functional-test" + minute: "00" + hour: "02" + job: "cd {{ testrig_dir }}/automationtests/target/ && java -jar -Dmodules=all -Denv.user=qa -Denv.endpoint=https://qa.mosip.net -Denv.testLevel=smokeAndRegression automationtests.jar" + when: testrig_folder.stat.exists == false \ No newline at end of file