Added Jenkinsfile
This commit is contained in:
parent
be9dddeb02
commit
dace389f04
1 changed files with 27 additions and 34 deletions
61
Jenkinsfile
vendored
61
Jenkinsfile
vendored
|
|
@ -1,38 +1,31 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
stages {
|
||||||
tools {
|
stage('Echo Version') {
|
||||||
// Install the Maven version configured as "M3" and add it to the path.
|
steps {
|
||||||
maven "M398"
|
sh 'echo Print Maven Version'
|
||||||
|
sh 'mvn -version '
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stage('Build') {
|
||||||
stage('Echo Version') {
|
steps {
|
||||||
steps {
|
sh 'mvn clean package -DskipTests=true'
|
||||||
// Get some code from a GitHub repository
|
archiveArtifacts 'target/hello-demo-*.jar'
|
||||||
sh 'echo Print Maven Version'
|
}
|
||||||
sh "mvn -version "
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Build') {
|
|
||||||
steps {
|
|
||||||
// Get some code from a GitHub repository (not needed if the file is part of repo )
|
|
||||||
// git branch: 'main', changelog: false, credentialsId: 'forgejo-https', poll: false, url: 'https://forgejo.tben.online/sandbox/jenkins-hello-world.git'
|
|
||||||
// Run Maven package
|
|
||||||
sh "mvn clean package -DskipTests=true"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Unit Test') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
for (int i = 0 ; i < 60; i++) {
|
|
||||||
echo "${i + 1}"
|
|
||||||
sleep 1
|
|
||||||
}
|
|
||||||
|
|
||||||
sh "mvn test"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
stage('Unit Test') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
sh "mvn test"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
tools {
|
||||||
|
maven 'M398'
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue