Jenkins: Difference between revisions

From My Limbic Wiki
(Page créée avec « =Continuous Delivery Pipeline= Jenkins have created the concept of "Pipeline As Code" <source lang="JSON"> Jenkinsfile (Declarative Pipeline) pipeline { agent any... »)
 
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Plugins=
* Pipeline
=Continuous Delivery Pipeline=
=Continuous Delivery Pipeline=
Jenkins have created the concept of "Pipeline As Code"
Jenkins have created the concept of "Pipeline As Code"


<source lang="JSON">
==Sample==
<source lang="PowerShell">
Jenkinsfile (Declarative Pipeline)
Jenkinsfile (Declarative Pipeline)
pipeline {
pipeline {
Line 26: Line 30:
}
}
</source>
</source>
=Pipelines=
==Pipeline Syntax==
In shell, it is not specific to the execution system
We can use methods like isUnix() to check on wich system it is running and exec a specific shell foreach
Allowing user to generate pipeline configuration code from jenkins UI
* Credentials
==Declarative Pipelines==
* contains directive or steps
* common directives : triggers parameters, tools, stages
==Github==
* it is possible to exec an sh file from distant repository
=Good to Know=
<source lang="PowerShell">
try{}catch(NullPointerException e){ echo "UNSTABLE"; }
</source>
* '''4 steps jenkins:''' checkout, compile, run the tests, package

Latest revision as of 18:51, 22 November 2019

Plugins

  • Pipeline

Continuous Delivery Pipeline

Jenkins have created the concept of "Pipeline As Code"

Sample

<source lang="PowerShell"> Jenkinsfile (Declarative Pipeline) pipeline {

   agent any
   stages {
       stage('Build') {
           steps {
               echo 'Building..'
           }
       }
       stage('Test') {
           steps {
               echo 'Testing..'
           }
       }
       stage('Deploy') {
           steps {
               echo 'Deploying....'
           }
       }
   }

} </source>

Pipelines

Pipeline Syntax

In shell, it is not specific to the execution system We can use methods like isUnix() to check on wich system it is running and exec a specific shell foreach Allowing user to generate pipeline configuration code from jenkins UI

  • Credentials

Declarative Pipelines

  • contains directive or steps
  • common directives : triggers parameters, tools, stages

Github

  • it is possible to exec an sh file from distant repository

Good to Know

<source lang="PowerShell"> try{}catch(NullPointerException e){ echo "UNSTABLE"; } </source>

  • 4 steps jenkins: checkout, compile, run the tests, package