-
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.
Merged in SHIBUI-794 (pull request #195)
SHIBUI-794 Approved-by: Dmitriy Kopylenko <dkopylenko@unicon.net> Approved-by: Bill Smith <wsmith@unicon.net>
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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 | ||
''' | ||
} | ||
} | ||
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/application.properties:/application.properties unicon/shibui:latest | ||
''' | ||
} | ||
} | ||
} | ||
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' | ||
} | ||
} | ||
} |
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,9 @@ | ||
FROM gcr.io/distroless/java | ||
|
||
ARG JAR_FILE | ||
|
||
COPY ${JAR_FILE} app.jar | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["app.jar"] |
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