All technological notes.
Domain-Specific Language (DSL)
Jenkins configurations as codeGroovyJob DSL (Plugin):
Jenkins jobs programmatically.Pipeline DSL:
Jenkinsfile.Declarative Pipeline:
Scripted Pipeline:
Job DSLJENKINS_HOME/dslseed job
Jenkins jobs automatically using code (DSL).Seed Job -> reads DSL script -> creates Jenkins jobs
Use the provided DSL script:
job("my_dsl_job"){
description('This is my DSL job.')
parameters {
stringParam('task_name', defaultValue = 'my jenkins task', description = "This is my task.")
booleanParam('isComplete', false)
choiceParam('type', ['option 1 (default)', 'option 2', 'option 3'])
}
scm {
git('https://github.com/jenkinsci/job-dsl-plugin','master')
}
triggers {
cron {spec("H/5 * * * *")}
}
steps {
shell("echo 'Hello world'")
}
publishers {
mailer("who@example.com", true, true)
}
}
Run build
Started by user admin
Running as SYSTEM
Building remotely on docker-agent (docker) in workspace /home/jenkins/agent/workspace/seed job
Processing provided DSL script
Added items:
GeneratedJob{name='my_dsl_job'}
Finished: SUCCESS
