forked from typelevel/fs2-grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
37 lines (35 loc) · 1.54 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
def label = "fs2-grpc-${UUID.randomUUID().toString().substring(0, 5)}"
podTemplate(label: label,
containers: [containerTemplate(name: 'sbt',
image: 'eu.gcr.io/cognitedata/openjdk8-sbt:2018-06-22-c73da5c',
resourceRequestCpu: '100m',
resourceLimitCpu: '2000m',
resourceRequestMemory: '3000Mi',
resourceLimitMemory: '3000Mi',
ttyEnabled: true,
command: '/bin/cat -')],
volumes: [secretVolume(secretName: 'sbt-credentials', mountPath: '/sbt-credentials'),
secretVolume(secretName: 'jenkins-docker-builder', mountPath: '/jenkins-docker-builder')]) {
node(label) {
container('jnlp') {
stage('Checkout') {
checkout(scm)
}
}
container('sbt') {
stage('Install SBT config') {
sh('mkdir -p /root/.sbt/1.0 && cp /sbt-credentials/credentials.sbt /root/.sbt/1.0/credentials.sbt')
sh('cp /sbt-credentials/repositories /root/.sbt/')
}
if (env.BRANCH_NAME == 'master') {
stage('Deploy') {
sh('sbt test publish')
}
} else {
stage('Compile & Test') {
sh('sbt test')
}
}
}
}
}