Files
jx-callback/deploy/ansible.yml
邹宗楠 0e59a39006 1
2022-08-03 17:19:22 +08:00

43 lines
1.2 KiB
YAML

---
- hosts: "{{ deploy_hosts }}"
remote_user: ubuntu
tasks:
- name: copy shell
copy:
src: ../deploy/cleanup.sh
dest: "{{ deploy_dir }}/cleanup.sh"
owner: ubuntu
group: ubuntu
mode: 0777
# - name: cleanup previous backup files
# shell: cd {{ deploy_dir }} && ./cleanup.sh
- name: copy execute file to dest
copy:
src: ../jx-callback
dest: "{{ deploy_dir }}/jx-callback"
owner: ubuntu
group: ubuntu
mode: 0755
backup: no
- name: copy conf file to dest
copy:
src: ../conf/
dest: "{{ deploy_dir }}/conf/"
owner: ubuntu
group: ubuntu
mode: 0555
- name: copy swagger files to dest
copy:
src: ../swagger
dest: "{{ deploy_dir }}/"
owner: ubuntu
group: ubuntu
mode: 0555
- name: shell
shell: cd {{ deploy_dir }}/conf && sed -i 's/runmode\s*=\s*.*/runmode = {{ runmode }}/' app.conf && sudo systemctl restart jx-api
when: runmode == "api"
- name: shell
shell: cd {{ deploy_dir }}/conf && sed -i 's/runmode\s*=\s*.*/runmode = {{ runmode }}/' app.conf && sudo systemctl restart jx-callback-{{ runmode }}
when: runmode != "api"