fix: check if deployment branch exists on remote; woodpecker only clones trigger branch
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
parent
800bb5687c
commit
99b0d49f5c
|
@ -98,12 +98,12 @@ deploy() {
|
|||
tmp_dir=$(mktemp -d)
|
||||
cp -r $2/* $tmp_dir
|
||||
|
||||
if [[ -z $(git branch --list $1) ]]
|
||||
if [[ -z $(git ls-remote --heads origin ${1}) ]]
|
||||
then
|
||||
"[*] Creating deployment branch $1"
|
||||
echo "[*] Creating deployment branch $1"
|
||||
git checkout --orphan $1
|
||||
else
|
||||
"[*] Deployment branch $1 exists, pulling changes from remote"
|
||||
echo "[*] Deployment branch $1 exists, pulling changes from remote"
|
||||
git pull origin $1 --force
|
||||
git checkout $1
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue