Bypass default SCM checkout on agents and use explicit git checkout
This commit is contained in:
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
@@ -2,13 +2,29 @@
|
||||
|
||||
pipeline {
|
||||
agent { label 'external-agent-1 || external-agent-2' }
|
||||
options { disableConcurrentBuilds() }
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
skipDefaultCheckout(true)
|
||||
}
|
||||
environment {
|
||||
PYENVPIPELINE_VIRTUALENV = '1'
|
||||
GIT_SSH_COMMAND = 'ssh -o StrictHostKeyChecking=accept-new'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
sh '''
|
||||
if [ -d .git ]; then
|
||||
git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git
|
||||
git fetch --tags --force --progress origin
|
||||
else
|
||||
git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git .
|
||||
fi
|
||||
git checkout -f origin/master
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh '''
|
||||
|
||||
Reference in New Issue
Block a user