Title: Theory / Important / CS / Development / Jenkins
Tags: automatedNewLineAfterCommaSpace

Name: Jenkins
Definition: Apache open source automation server to test and deploy
Page: https://www.jenkins.io/

Name: Step
Definition: a single command which performs a single action.
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Context: Jenkins

Name: Pipeline
Definition: A sequence of steps
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Context: Jenkins

Name: A succesfully executed pipeline
Definition: A pipeline whose all steps were succesfully exececuted
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Context: Jenkins

Instruction: sh 'foo' or
sh '''
   foo
'''
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: Execute the shell command foo
Language: Jenkins
Context: step

Instruction: bat 'foo' or
sh '''
   foo
'''
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: Execute the batch (windows) command foo
Language: Jenkins
Context: step

Instruction: retry(n) {
   steps
}
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: Execute steps until it succeed, or fails after n failure
Language: Jenkins
Context: step

Instruction: timeout(
  time: n,
  unit: 'Unit'
) {
   steps
}
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: Execute steps. Fails if it takes more than n unit of time
Language: Jenkins
Context: step

Instruction: echo 'foo'
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: Print foo on stdout
Language: Jenkinsfile
Context: Jenkins

Instruction: post {
  always {
     foo
  }
}
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: After the pipeline ended, do foo
Language: Jenkinsfile

Instruction: post {
  success {
     foo
  }
}
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: After the pipeline ended succesfully, do foo
Language: Jenkinsfile

Instruction: post {
  failure {
     foo
  }
}
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: After the pipeline failed, do foo
Language: Jenkinsfile

Instruction: post {
  changed {
     foo
  }
}
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: After the pipeline ended with a state distinct of last execution, do foo
Language: Jenkinsfile

Instruction: post {
  unstable {
     foo
  }
}
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: After the pipeline ended and marked as unstable, do foo
Language: Jenkinsfile

Instruction: agent {
  foo
}
Page: https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/
Effect: Uses foo to indicate what agent will execute the steps
Language: Jenkinsfile
Example: docker

Instruction: environment {
  var_1 = 'value_1'
  ...
  var_n = 'value_n'
}
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Effect: In the current curly braces, the variable var_i has value value_i
Language: Jenkinsfile

Instruction: stages {
  foo_1
  ...
  foo_n
}
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Effect: Indicate that the various stages are the foo_i
Language: Jenkinsfile
Where to use it: pipeline

Instruction: stage ('foo') {
  ...
}
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Effect: Define a jenkin stage named foo
Language: Jenkinsfile
Where to use it: stages

Name: Unstable pipeline
Definition: A pipeline with failing test
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Context: Jenkins

Name: Failed pipeline
Definition: A pipeline where some step fail
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Context: Jenkins

Name: Succesful pipeline
Definition: A pipeline where all Build and all tests succeedd
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Context: Jenkins

Instruction: junit 'pattern'
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Effect: Search for all files satisfying pattern for junit style test report, to check for failed test
Language: jenkinsfile
Context: Jenkins

Instruction: archiveArtifacts foo
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Effect: Preserve all files matching foo after the pipeline ends
Language: jenkinsfile
Context: Jenkins
Intuition: Help debugging by saving intermediate files

Instruction: mail to: 'address'
        subject: "title"
        body: "content"
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Effect: Send email with address, title and content
Language: jenkinsfile
Context: Jenkins

Instruction: slackSend channel: 'chan'
                 send: "content"
Page: https://www.jenkins.io/doc/pipeline/tour/environment/
Effect: Tell content slack channel chan
Language: jenkinsfile
Context: Jenkins

Instruction: input foo
Page: https://www.jenkins.io/doc/pipeline/tour/deployment/
Effect: Send message foo to user and ask for confirmation to proceed
Language: jenkinsfile
Context: Jenkins

Instruction: $foo
Page: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
Language: groovy
Returns: Value assigned to the variable foo

Name: Restart from Stage
Definition: Allow to restart a run which failed in the same state
Page: https://www.jenkins.io/doc/book/pipeline/running-pipelines/
Context: Jenkin
Intuition: assume its a transient error that disappear

Name: Multibranch pipeline
Definition: Having different build process for various branch of the same project
Page: https://www.jenkins.io/doc/book/pipeline/multibranch/
Context: Jenkin