您可以创建简单的作业"free-style job"
或"pipelines"
。管道功能更强大,但如果您要启动,则更加复杂。
您可以从为每个项目创建作业开始。然后,您可以使用不同的jenkins选项链接项目。当一个作业完成时,另一个作业开始。见下图。
您还可以用来编译现有的plugin for existing RAD Studio for Jenkins。在"free-style job"
中使用它。
另一个选择是使用管道,但是您应该对Groovy有所了解。
例如,具有几个步骤的简单管道就是这样:
pipeline {
agent any
stages {
stage('Stage: Show message Hola Mundo') {
steps {
echo 'Paso 1. Hola Mundo'
}
}
stage('Download source from GIT') {
steps {
echo 'Downloading...'
git([url: 'https://XXX_repository_xxxx.git/gitProject',branch: 'master',credentialsId: 'a234234a-344e-2344-9440-423444xxxxxx'])
}
}
stage('Executing MSDOS file (BAT)') {
steps {
echo '-- Sample Executing BAT file'
bat '"c:\\Program Files (x86)\\Embarcadero\\Studio\\19.0\\bin\\rsvars.bat"'
}
}
stage('MSBuild a Delphi project') {
steps {
println("************ EXECUTING MSBUILD ******************")
echo '-- Lanzar la ejecución de rsVars ---------'
bat '"c:\\Program Files (x86)\\Embarcadero\\Studio\\19.0\\bin\\rsvars.bat"'
echo '-- MSBuils del proyecto TestLauncher -------'
bat '"c:\\local\\AutomaticTestsProject\\compilar.bat"'
}
}
stage('Execute a test project (EXE)') {
steps {
bat 'c:\\local\\AutomaticTestsProject\\BIN\\AutomaticTestsProject.exe'
}
}
stage('Send emeil') {
steps {
emailext (
subject: "Job '${env.JOB_NAME} ${env.BUILD_NUMBER}'",body: """<p>Check console output at <a href="${env.BUILD_URL}">${env.JOB_NAME}</a></p>""",to: "destinatary@hotmail.com",from: "JenkinsMachine@mail.com" )
}
}
}
}
本文链接:https://www.f2er.com/3110722.html