Skip to content
Permalink
master
Go to file
2 contributors

Users who have contributed to this file

@jj @dima767
57 lines (55 sloc) 1.52 KB
pipeline {
agent any
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
stages {
stage('Build') {
steps {
sh './gradlew clean build'
}
post {
always {
junit 'backend/build/test-results/**/*.xml'
jacoco execPattern: '**/build/jacoco/test.exec'
}
}
}
stage('Build Docker images') {
when {
expression {
return GIT_BRANCH in ['master']
}
}
steps {
sh '''./gradlew docker -x test
'''
}
}
stage('Deploy') {
when {
expression {
return GIT_BRANCH in ['master']
}
}
steps {
sh '''
docker stop shibui || true && docker rm shibui || true
docker run -d --restart always --name shibui -p 8080:8080 -v /etc/shibui:/conf -v /etc/shibui/application.yml:/application.yml -m 2GB --memory-swap=4GB --entrypoint /usr/bin/java unicon/shibui:latest -Xmx1G -jar app.war
'''
}
}
}
post {
failure {
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])])
}
success {
emailext body: '''${SCRIPT, template="groovy-text.template"}''', recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']], subject: '[SHIBUI] Build Success'
}
always {
cleanWs()
}
}
}
You can’t perform that action at this time.