forked from jenkins-docs/simple-java-maven-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Jenkinsfile example + wrap wording in README.md
- Loading branch information
Showing
2 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
} | ||
} | ||
} |