- make root dir clean.
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
- hosts: "{{ deploy_hosts }}"
|
- hosts: "{{ deploy_hosts }}"
|
||||||
remote_user: ubuntu
|
remote_user: ubuntu
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: cleanup previous backup files
|
||||||
|
shell: cd /jxdata/jx-callback/deploy && ./cleanup.sh
|
||||||
- name: copy execute file to dest
|
- name: copy execute file to dest
|
||||||
copy:
|
copy:
|
||||||
src: ../jx-callback
|
src: ../jx-callback
|
||||||
@@ -17,6 +19,5 @@
|
|||||||
owner: ubuntu
|
owner: ubuntu
|
||||||
group: ubuntu
|
group: ubuntu
|
||||||
mode: 0555
|
mode: 0555
|
||||||
backup: yes
|
|
||||||
- name: shell
|
- name: shell
|
||||||
shell: cd /jxdata/jx-callback/conf && sed -i 's/runmode\s*=\s*.*/runmode = {{ runmode }}/' app.conf && sudo systemctl restart jx-callback
|
shell: cd /jxdata/jx-callback/conf && sed -i 's/runmode\s*=\s*.*/runmode = {{ runmode }}/' app.conf && sudo systemctl restart jx-callback
|
||||||
|
|||||||
9
deploy/cleanup.sh
Executable file
9
deploy/cleanup.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ ! -d "../backup" ]; then
|
||||||
|
mkdir ../backup
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "../jx-callback.*~" ] then
|
||||||
|
mv ../jx-callback.*~ ../backup/
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user