Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pratikshinde55/jenkins-pipeline-ways
Methods of create Jenkins Pipeline that is manual pipeline and pipeline as code(Jenkinsfile)
https://github.com/pratikshinde55/jenkins-pipeline-ways
declarative jenkins jenkins-dsl-scripts jenkins-groovy jenkinsfile
Last synced: about 1 month ago
JSON representation
Methods of create Jenkins Pipeline that is manual pipeline and pipeline as code(Jenkinsfile)
- Host: GitHub
- URL: https://github.com/pratikshinde55/jenkins-pipeline-ways
- Owner: Pratikshinde55
- Created: 2024-06-27T09:45:27.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-25T13:45:20.000Z (5 months ago)
- Last Synced: 2024-11-14T02:25:44.615Z (3 months ago)
- Topics: declarative, jenkins, jenkins-dsl-scripts, jenkins-groovy, jenkinsfile
- Homepage:
- Size: 90.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jenkins-pipeline-ways
We can create pipeline by two ways in Jenkins :
1. pipeline as code (automatic)
2. Manual pipeline## 1. Pipeline as Code:
**Pipeline as code can create by using "Groovy language". It is DSL ( Domain-Specific Language)****Groovy Language also run on JVM (Java virtual machine).**
Ways of write Pipeline as code:
1. Declarative – a new way of creating Jenkins Pipeline. Here you write groovy code containing “pipeline” blocks.
2. Scripted
Ways of create pipeline as Code:
1. Jenkinsfile (Create on local or gitHub and access by Jenkins WebUI)
2. Direct create Declarative Script on Jenkins WebUI.- For Pipeline as code following terms are use in Jenkinsfile or Jenkins WebUI:
**pipeline**: It is keyword which use for declare this pipeline as code. It is main block in which we put all stages, steps, agents, and so on.
**agent** : It is about on which node we want to run stage/job or pipeline, By Using "label" we specify that on which node we want execute pipeline.
**stages** : All Multiple Stage (Jobs) put in one block that is known as stages block {}.
**stage** : This is means job, consider we can create jobA, JobB, JobC that job is known as Stage.
**steps** : Tt is sub-block of stage. In every job we can do somethings that things in stage is known as steps.
#### Jenkinsfile:
It is Standard name of the file in which pipeline as code store. (when use Jenkinsfile it means create pipeline as Code by Pipeline script from SCM)
- Now Create pipeline as Code: (Select 'pipeline' for create pipeline as code)
- Now there is Two ways for create pipeline as code:
1. Pipeline Script
2. Pipeline Script from SCM (gitHub)
- Create pipeline by using Pipeline Script way :
- Check Script output :
- we can see that our pipeline as code work or not, on console output of our job.
## 2. Manual jenkins pipeline (jenkins WebUI):
- Upstream :
If jobA run then after next automatic JobB run , it means JobA is upstream of JobB .
- Downsteram:
If jobA run then after next jobB automatic start then JobB is downstream job of jobA.
For this jenkins give many plugins which give different view for pipeline .for manual pipeline i install "Build pipeline plugin and Delivery pipeline plugin" and restart jenkins:
Jenkins Dashboard -->> Manage jenkins -->> plugins
create manual pipeline:
- create individual three job and connect them by "post action" or trigger.
- one job connect to other by manual
create jobA , JobB, JobC 'freestyle'For JobA:--- ( Here we can create JobB downstream for jobA )

For JobB:--- ( Here we can create JobC downstream for jobB )

Now we can create 'New view' file jenkins Dashboard :

### 1. Now create by Build pipeline view :
This is option only come when we install Build pipeline plugin
we can add multiple feature and button and also we add different jobs,
Only need to give Initial Job

see pipeline :
### 2. Now create by Delivery pipeline view:
This pipeline plugin give visual view. we can add multiple features and buttons.Only need to initial job and also we can give final job of pipeline.
go to "My view" -->> "new View" -->> "Delivery Pipeline View"

we can get follow view :

- Note :
Also we can add new job which is run wehn other run, menas we can add upstream job for new JobD.we can create by using "Build trigger" -->> "Build after other projects are built"

pipeline view by delivery plugin:
