forked from cloudify/sPDF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
75 lines (70 loc) · 1.91 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
pipeline {
agent {
kubernetes {
inheritFrom 'default'
containerTemplates([
containerTemplate(name: 'play', image: 'flowdocker/play_builder:latest-java17-jammy', command: 'cat', ttyEnabled: true),
])
}
}
options {
disableConcurrentBuilds()
}
stages {
stage('Checkout') {
steps {
checkoutWithTags scm
}
}
stage('Tag new version') {
when { branch 'main' }
steps {
script {
VERSION = new flowSemver().calculateSemver()
new flowSemver().commitSemver(VERSION)
}
}
}
stage('SBT Test') {
steps {
container('play') {
script {
try {
sh '''
sbt clean coverage test:compile test
sbt coverageAggregate
'''
} finally {
junit allowEmptyResults: true, testResults: '**/target/test-reports/*.xml'
step([$class: 'ScoveragePublisher', reportDir: 'target/scala-2.13/scoverage-report', reportFile: 'scoverage.xml'])
publishHTML (target : [allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'target/scala-2.13/scoverage-report',
reportFiles: 'index.html',
reportName: 'Scoverage Code Coverage',
reportTitles: 'Scoverage Code Coverage'])
}
}
}
}
}
stage('Release') {
when { branch 'main' }
steps {
container('play') {
withCredentials([
usernamePassword(
credentialsId: 'jenkins-x-jfrog',
usernameVariable: 'ARTIFACTORY_USERNAME',
passwordVariable: 'ARTIFACTORY_PASSWORD'
)
]) {
sh 'sbt clean +publish'
syncDependencyLibrary()
}
}
}
}
}
}