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-20 03:37:20 +03:00
|
|
|
sh 'mvn package'
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Deploy') {
|
|
|
|
steps {
|
2019-01-02 15:25:04 +03:00
|
|
|
// TODO: consider switch to docker registry
|
2019-01-01 23:20:10 +03:00
|
|
|
sh 'cp ./target/InnaIrcBot-*-jar-with-dependencies.jar /rel/InnaIrcBot.jar'
|
|
|
|
// sh 'docker restart innaircbot'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-01-09 14:47:52 +03:00
|
|
|
post {
|
|
|
|
always {
|
|
|
|
archiveArtifacts artifacts: 'target/*-jar-with-dependencies.jar', onlyIfSuccessful: true
|
|
|
|
}
|
|
|
|
}
|
2019-01-01 23:20:10 +03:00
|
|
|
}
|