playbooks/clone-repo: added condition when repo is already cloned

Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmüller 2023-06-13 12:37:48 +02:00
parent 1960187318
commit 35e28eb1a3
1 changed files with 6 additions and 1 deletions

View File

@ -30,9 +30,14 @@
ansible.builtin.shell: |
eval `ssh-agent -s`
SSH_PASS={{ssh_passphrase}} DISPLAY=1 SSH_ASKPASS="{{ssh_auto_sshadd_file}}" ssh-add {{ssh_keyfile}} < /dev/null
git clone ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git {{git_repo_path}}
if [[ ! -d {{git_repo_path}} ]]; then
git clone ssh://git@bitbucket.gad.local:7999/nm-nsp/nwl-ci.git {{git_repo_path}}
fi
cd {{git_repo_path}}
git checkout develop
git fetch -ap
git pull
args:
executable: /bin/bash
no_log: true