Skip to content

Commit

Permalink
Add Jenkinsfile example + wrap wording in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesgas committed Oct 5, 2017
1 parent 77f2f02 commit 2dc5ed5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# simple-java-maven-app

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/).
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/).

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.
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.

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.
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.
25 changes: 25 additions & 0 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
pipeline {
agent {
docker {
image 'maven:3-alpine'
args '-v /root/.m2:/root/.m2'
}
}
stages {
stage('Build') {
steps {
sh 'mvn -B -DskipTests clean package'
}
}
stage('Test') {
steps {
sh 'mvn test'
}
}
stage('Deliver') {
steps {
sh './jenkins/scripts/deliver.sh'
}
}
}
}

0 comments on commit 2dc5ed5

Please sign in to comment.