Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tknerr/jenkins-pipes-helloworld
Example project with a Jenkinsfile for the Jenkins Pipes demo
https://github.com/tknerr/jenkins-pipes-helloworld
Last synced: about 2 months ago
JSON representation
Example project with a Jenkinsfile for the Jenkins Pipes demo
- Host: GitHub
- URL: https://github.com/tknerr/jenkins-pipes-helloworld
- Owner: tknerr
- Created: 2017-02-07T21:01:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-11-10T07:05:20.000Z (about 2 years ago)
- Last Synced: 2023-03-23T00:22:24.547Z (almost 2 years ago)
- Language: Shell
- Homepage: https://github.com/tknerr/jenkins-pipes-infra
- Size: 3.91 KB
- Stars: 9
- Watchers: 3
- Forks: 87
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jenkins Pipes HelloWorld
A minimal and stupid "helloworld" example project for the [Jenkins Pipes](https://github.com/tknerr/jenkins-pipes-infra) demo:
* the `Jenkinsfile` describes **HOW** to build this project in [Pipeline-DSL](https://jenkins.io/doc/book/pipeline/syntax/)
## How it works
This example will be built on our [jenkins-pipes-infra](https://github.com/tknerr/jenkins-pipes-infra/blob/master/Dockerfile) because in [jenkins-pipes-jobs](https://github.com/tknerr/jenkins-pipes-jobs/blob/master/ci_jobs.groovy) we configured to build all `master` and `feature/*` branches of this repo.
The `Jenkinsfile` in here describes **HOW** this project is built, in terms of the individual stages that make up the build pipeline and what happens within them:
```groovy
node {
try {
stage('checkout') {
checkout scm
}
stage('prepare') {
sh "git clean -fdx"
}
stage('compile') {
echo "nothing to compile for hello.sh..."
}
stage('test') {
sh "./test_hello.sh"
}
stage('package') {
sh "tar -cvzf hello.tar.gz hello.sh"
}
stage('publish') {
echo "uploading package..."
}
} finally {
stage('cleanup') {
echo "doing some cleanup..."
}
}
}
```The `master` branch build should succeed:
![image](https://cloud.githubusercontent.com/assets/365744/22727812/3ad04a26-eddb-11e6-9dd9-5d2e5a975f22.png)
The `feature/make-it-fail` branch shows how a build failure looks like:
![image](https://cloud.githubusercontent.com/assets/365744/22727851/688829b6-eddb-11e6-8233-6503c5a6fa49.png)
## Where to go from here?
Now that you have a minimal example running, here are some ideas on how to dig further:
* go and explore the [Pipeline-DSL](https://jenkins.io/doc/book/pipeline/syntax/) and [Steps Reference](https://jenkins.io/doc/pipeline/steps/)
* add email notifications on success / failure
* create a similar helloworld example in your favorite programming language
* use node labels to run your builds on specific nodes only
* try modeling more complex pipelines with parallel execution etc
* ...