📌  相关文章
📜  job('DSL-Tutorial-1-Test') { scm { git('git: github.com quidryan aws-sdk-test.git') } 触发器 { scm('H 15 * * * *') } 步骤 { maven('-e clean test') } } - Shell-Bash (1)

📅  最后修改于: 2023-12-03 15:16:40.347000             🧑  作者: Mango

DSL-Tutorial-1-Test Job

This Jenkins job is an example of using Jenkins Pipeline DSL to define a complex build process.

Description

This job is defined using the job DSL script in Jenkins. It uses the Jenkins Pipeline plugin and DSL syntax to define the build steps, triggers, SCM, and other configurations.

The job is triggered automatically every hour (at 15 minutes past the hour) using the SCM trigger. Whenever there is a new commit on the master branch of the aws-sdk-test repository on GitHub, the pipeline will be triggered to build and run the unit tests using the Maven build tool.

Pipeline Steps

The pipeline steps are defined in the DSL script as follows:

maven('-e clean test')

This step uses Maven to invoke the clean and test phases of the build.

SCM Trigger

The SCM trigger is defined in the DSL script as follows:

scm('H 15 * * * *')

This triggers the pipeline to run whenever there is a new commit on the master branch of the aws-sdk-test repository on GitHub.

Conclusion

This Jenkins job is an example of how to use Jenkins Pipeline DSL to define a complex build process that is triggered by changes in the source code. By using the Pipeline plugin and DSL syntax, it is possible to define a build process that is easy to read, maintain, and extend.