diff --git a/05_01.md b/05_01.md new file mode 100644 index 0000000..c3134e3 --- /dev/null +++ b/05_01.md @@ -0,0 +1,39 @@ +# Learning Jenkins, 05-01: Pipeline as Code +Create a pipeline job. + +Paste the following code in the pipeline definition: +``` +pipeline { + agent any + options { + buildDiscarder(logRotator(daysToKeepStr: '10', numToKeepStr: '10')) + timeout(time: 12, unit: 'HOURS') + timestamps() + } + triggers { + cron '@midnight' + } + stages { + stage('Initialize') { + steps { + echo 'Initializing..' + } + } + stage('Build') { + steps { + echo 'Building..' + } + } + stage('Test') { + steps { + echo 'Testing..' + } + } + stage('Report') { + steps { + echo 'Reporting....' + } + } + } +} +``` diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f75705f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,33 @@ +pipeline { + agent any + options { + buildDiscarder(logRotator(daysToKeepStr: '10', numToKeepStr: '10')) + timeout(time: 12, unit: 'HOURS') + timestamps() + } + triggers { + cron '@midnight' + } + stages { + stage('Initialize') { + steps { + echo 'Initializing..' + } + } + stage('Build') { + steps { + echo 'Building..' + } + } + stage('Test') { + steps { + echo 'Testing..' + } + } + stage('Report') { + steps { + echo 'Reporting....' + } + } + } +}