Spencer Nicholls
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
0 additions and
39 deletions
-
05_01.md
|
|
|
@ -1,39 +0,0 @@ |
|
|
|
# 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('Deploy') { |
|
|
|
steps { |
|
|
|
echo 'Deploying....' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
``` |