Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure PR #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,8 @@ pipeline {
stages {
stage('Build') {
steps {
echo 'This is the Build Stage'
}
}
stage('Test') {
steps {
echo 'This is the Testing Stage'
}
}
stage('Deploy') {
steps {
echo 'This is the Deploy Stage'
// invalid command to let build fail
sh 'ggcomand'
}
}
}
Expand Down
45 changes: 1 addition & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,48 +51,5 @@ Enter you jenkins hook url then click `Add service`

Note: If you run jenkins on localhost, you can use [ngrok](https://ngrok.com/) to setup the hook url.

Push the changes to github, and you can see green check in your commits. That means the commit pass your pipeline.
## Failure PR

![](screenshots/jenkins_work_in_commit.png)

### Success PR

```sh
git checkout -b success_pr
echo 'success' >> README.md
git add .
git commit -m "Add readme"
git push -u origin success_pr
```

![success PR](screenshots/success_pr.png)

### Failure PR

```sh
git checkout -b failure_pr
```

Change Jenkinsfile

```Jenkinsfile
pipeline {
agent any
stages {
stage('Build') {
steps {
// invalid command to let build fail
sh 'ggcomand'
}
}
}
}
```

```sh
git add .
git commit -m "Add broken commit"
git push -u origin failure_pr
```

![failure PR](screenshots/failure_pr.png)