尽管使用skipDefaultCheckout true,它仍然会克隆git repo。 我的目标只是寻找更改,然后执行某些脚本。 我的想法已经用完了。我尝试过此How to use SkipDefaultCheckout in a scripted pipeline,但我怀疑它不起作用吗?
pipeline {
agent any
options {
skipDefaultCheckout true
}
environment {
branch = 'test'
}
stages {
stage('commit_stage') {
steps {
script {
properties([pipelineTriggers([pollSCM('*/5 * * * *')])])
git branch: "${branch}", credentialsId: 'test', url: 'https://gitlab.test.net/core/test.git'
sh '''
branch=${branch}
ssh bamboo@app-test.synchr.net "cd /opt/${branch}-8*/ && ./startup.sh status"
'''
}
//define scm connection for polling
}
}
}
}
答案 0 :(得分:0)
看起来您的选项语法错误。您已经:
options {
skipDefaultCheckout true
}
应该是
options {
skipDefaultCheckout()
}