innaircbot/Jenkinsfile

38 lines
1,002 B
Text
Raw Normal View History

2019-01-01 23:20:10 +03:00
pipeline {
agent {
docker {
image 'maven:3-alpine'
2019-01-02 15:25:04 +03:00
args '-v /home/docker/jenkins/files/m2:/root/.m2 -v /home/docker/innaircbot/files/artifact:/rel'
2019-01-01 23:20:10 +03:00
}
}
stages {
stage('Build') {
steps {
2020-10-30 02:08:36 +03:00
sh 'mvn -B -DskipTests clean package'
}
post {
success {
archiveArtifacts artifacts: 'target/*.jar, target/*.exe'
}
2019-01-01 23:20:10 +03:00
}
}
stage('Test') {
steps {
2020-10-20 03:37:20 +03:00
sh 'mvn test'
2019-01-01 23:20:10 +03:00
}
2020-10-30 02:08:36 +03:00
post {
always {
junit 'target/surefire-reports/*.xml'
}
}
2019-01-01 23:20:10 +03:00
}
stage('Deploy') {
steps {
sh 'cp ./target/InnaIrcBot-*-jar-with-dependencies.jar /rel/InnaIrcBot.jar'
2020-10-30 02:08:36 +03:00
// TODO: consider switch to docker registry
2019-01-01 23:20:10 +03:00
// sh 'docker restart innaircbot'
}
}
}
}