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 {
|
pipeline {
|
||||||
agent { label 'external-agent-1 || external-agent-2' }
|
agent { label 'external-agent-1 || external-agent-2' }
|
||||||
options { disableConcurrentBuilds() }
|
options {
|
||||||
|
disableConcurrentBuilds()
|
||||||
|
skipDefaultCheckout(true)
|
||||||
|
}
|
||||||
environment {
|
environment {
|
||||||
PYENVPIPELINE_VIRTUALENV = '1'
|
PYENVPIPELINE_VIRTUALENV = '1'
|
||||||
GIT_SSH_COMMAND = 'ssh -o StrictHostKeyChecking=accept-new'
|
GIT_SSH_COMMAND = 'ssh -o StrictHostKeyChecking=accept-new'
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
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') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
|
|||||||
Reference in New Issue
Block a user