From 01acd04ed2229118f27a9e6b59336a75f95e35e6 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 7 Aug 2018 09:41:19 +0800 Subject: [PATCH] - fix deploy error. --- deploy/ansible.yml | 9 ++++++++- deploy/cleanup.sh | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/deploy/ansible.yml b/deploy/ansible.yml index 2240ebfd4..aad975233 100644 --- a/deploy/ansible.yml +++ b/deploy/ansible.yml @@ -2,8 +2,15 @@ - hosts: "{{ deploy_hosts }}" remote_user: ubuntu tasks: + - name: copy shell + copy: + src: ../deploy/cleanup.sh + dest: /jxdata/jx-callback/cleanup.sh + owner: ubuntu + group: ubuntu + mode: 0777 - name: cleanup previous backup files - shell: cd /jxdata/jx-callback/deploy && ./cleanup.sh + shell: ./cleanup.sh - name: copy execute file to dest copy: src: ../jx-callback diff --git a/deploy/cleanup.sh b/deploy/cleanup.sh index 49d6a345b..801bbf0e8 100755 --- a/deploy/cleanup.sh +++ b/deploy/cleanup.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash -if [ ! -d "../backup" ]; then - mkdir ../backup +if [ ! -d "backup" ]; then + mkdir backup fi -if [ -f "../jx-callback.*~" ] then - mv ../jx-callback.*~ ../backup/ +if [ -f "jx-callback.*~" ] then + mv jx-callback.*~ backup/ fi