Browse Source

Add files for 05_01

05_01
Michael Jenkins 4 years ago
parent
commit
b02054587a
2 changed files with 72 additions and 0 deletions
  1. +39
    -0
      05_01.md
  2. +33
    -0
      Jenkinsfile

+ 39
- 0
05_01.md View File

@ -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....'
}
}
}
}
```

+ 33
- 0
Jenkinsfile View File

@ -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....'
}
}
}
}

Loading…
Cancel
Save