From 2bc85007148b5900620f08b655ae0b91f04e1a87 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 17 Sep 2018 14:38:02 +0800 Subject: [PATCH] - support alpha deploy. --- deploy/ansible.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/deploy/ansible.yml b/deploy/ansible.yml index e74b0f47d..fa3727889 100644 --- a/deploy/ansible.yml +++ b/deploy/ansible.yml @@ -5,16 +5,16 @@ - name: copy shell copy: src: ../deploy/cleanup.sh - dest: /jxdata/jx-callback/cleanup.sh + dest: "{{ deploy_dir }}/cleanup.sh" owner: ubuntu group: ubuntu mode: 0777 - name: cleanup previous backup files - shell: cd /jxdata/jx-callback && ./cleanup.sh + shell: cd {{ deploy_dir }} && ./cleanup.sh - name: copy execute file to dest copy: src: ../jx-callback - dest: /jxdata/jx-callback/jx-callback + dest: "{{ deploy_dir }}/jx-callback" owner: ubuntu group: ubuntu mode: 0755 @@ -22,17 +22,22 @@ - name: copy conf file to dest copy: src: ../conf/app.conf - dest: /jxdata/jx-callback/conf/app.conf + dest: "{{ deploy_dir }}/conf/app.conf" owner: ubuntu group: ubuntu mode: 0555 - name: copy swagger files to dest copy: src: ../swagger - dest: /jxdata/jx-callback/ + dest: "{{ deploy_dir }}/" owner: ubuntu group: ubuntu mode: 0555 - 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 {{ deploy_dir }}/conf && sed -i 's/runmode\s*=\s*.*/runmode = {{ runmode }}/' app.conf && sudo systemctl restart jx-callback + when: runmode == "prod" + + - 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 != "prod"