Fix pipeline checkout ref resolution on agents
This commit is contained in:
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@@ -19,11 +19,12 @@ pipeline {
|
|||||||
export GIT_SSH_COMMAND="ssh -i $GIT_KEYFILE -o StrictHostKeyChecking=accept-new"
|
export GIT_SSH_COMMAND="ssh -i $GIT_KEYFILE -o StrictHostKeyChecking=accept-new"
|
||||||
if [ -d .git ]; then
|
if [ -d .git ]; then
|
||||||
git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git
|
git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git
|
||||||
git fetch --tags --force --progress origin
|
git fetch --tags --force --progress origin +refs/heads/master:refs/remotes/origin/master
|
||||||
else
|
else
|
||||||
git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git .
|
git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git .
|
||||||
|
git fetch --tags --force --progress origin +refs/heads/master:refs/remotes/origin/master
|
||||||
fi
|
fi
|
||||||
git checkout -f origin/master
|
git checkout -f refs/remotes/origin/master
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user