Skip to content

Commit 2dc5ed5

Browse files
committed
Add Jenkinsfile example + wrap wording in README.md
1 parent 77f2f02 commit 2dc5ed5

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# simple-java-maven-app
22

3-
This repository is for the [Using Jenkins to build a Java/Maven project]( https://jenkins.io/doc/tutorials/using-jenkins-to-build-a-java-maven-project/) tutorial in the [Jenkins User Documentation](https://jenkins.io/doc/).
3+
This repository is for the [Using Jenkins to build a Java/Maven project]( https://jenkins.io/doc/tutorials/using-jenkins-to-build-a-java-maven-project/)
4+
tutorial in the [Jenkins User Documentation](https://jenkins.io/doc/).
45

5-
The repository contains a simple Java application which outputs the string "Hello world!" and is accompanied by a unit test to check that the main application works as expected.
6+
The repository contains a simple Java application which outputs the string
7+
"Hello world!" and is accompanied by a unit test to check that the main
8+
application works as expected.
69

7-
The `jenkins` directory contains an example of the `Jenkinsfile` (i.e. Pipeline) you'll be creating yourself during the tutorial and the `scripts` directory contains a shell script with commands that are executed when Jenkins processes the "Deliver" stage of your Pipeline.
10+
The `jenkins` directory contains an example of the `Jenkinsfile` (i.e. Pipeline)
11+
you'll be creating yourself during the tutorial and the `scripts` directory
12+
contains a shell script with commands that are executed when Jenkins processes
13+
the "Deliver" stage of your Pipeline.

jenkins/Jenkinsfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pipeline {
2+
agent {
3+
docker {
4+
image 'maven:3-alpine'
5+
args '-v /root/.m2:/root/.m2'
6+
}
7+
}
8+
stages {
9+
stage('Build') {
10+
steps {
11+
sh 'mvn -B -DskipTests clean package'
12+
}
13+
}
14+
stage('Test') {
15+
steps {
16+
sh 'mvn test'
17+
}
18+
}
19+
stage('Deliver') {
20+
steps {
21+
sh './jenkins/scripts/deliver.sh'
22+
}
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)