Explanation
It looks like you are trying to set up a Pipeline job (formerly known as Workflow). This type of job is very different from Job DSL .
The purpose of the Pipeline job is to:
Organizes lengthy activities that can span multiple slaves. Suitable for the construction of pipelines (formerly called workflows) and / or the organization of complex events that do not easily fit into the type of work in a free style.
Where as a DSL job:
... allows you to program the creation of projects using DSL. Pressing a job creation in a script allows you to automate and standardize your Jenkins installation, unlike everything that was before.
Decision
If you want to check your code for a specific directory, replace git with the more general SCM checkout step. The final Pipeline configuration should look like this:
node { stage "checkout" //git([url:"https://github.com/luxengine/math.git"]) checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'checkout-directory']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/luxengine/math.git']]]) stage "build" echo "Building from pipeline" }
As a future reference for Jenkins 2.0 and Pipeline DSL, please use the built-in fragment generator or documentation .
luka5z
source share