Skip to content

Commit

Permalink
setup cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
mandeepdhiman123 committed Sep 7, 2020
1 parent 0598287 commit e06a646
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions mosip-security-playbook/roles/functional-test-setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

- pause:
prompt: "Do you want to clone and build again (yes/no)?"
default: no
register: check_for_rebuild
default: no
when: testrig_folder.stat.exists == true

- name: "Deleting old build"
Expand All @@ -26,28 +26,56 @@
state: absent
when: check_for_rebuild.user_input | bool

- name: Download and Unarchive Functional Test
- 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 partner demo service for dependency
- 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 test-rig
- 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: 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: 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 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: 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"
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

0 comments on commit e06a646

Please sign in to comment.