This repository has been archived by the owner on May 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
72 lines (59 loc) · 2.28 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
#!/usr/bin/env groovy
pipeline {
agent {
label 'java8'
}
post {
always {
junit allowEmptyResults: true, testResults: 'build/test-results/**/*.xml'
}
success {
ircSendSuccess()
}
failure {
ircSendFailure()
}
}
environment {
GRADLE_OPTIONS = "--no-daemon --rerun-tasks -PBUILD_NUMBER=${env.BUILD_NUMBER} -PBRANCH=\"${env.BRANCH_NAME}\""
}
stages {
stage('Checkout') {
steps {
ircSendStarted()
checkout scm
sh "rm -Rv build || true"
}
}
stage('Build & Test') {
steps {
sh "./gradlew ${env.GRADLE_OPTIONS} clean build test"
sh "./gradlew ${env.GRADLE_OPTIONS} generatePomFileForMavenJavaPublication"
}
}
stage('Coverage') {
environment {
CODECOV_TOKEN = credentials('chat.willow.burrow.codecov')
}
steps {
sh "./gradlew ${env.GRADLE_OPTIONS} jacocoTestReport"
step([$class: 'JacocoPublisher'])
sh "./codecov.sh -B ${env.BRANCH_NAME}"
}
}
stage('Archive') {
steps {
archive includes: 'build/libs/*.jar'
}
}
stage('Deploy') {
steps {
sh "find build/libs -name Burrow\\*${env.BUILD_NUMBER}.jar | head -n 1 | xargs -I '{}' mvn install:install-file -Dfile={} -DpomFile=build/publications/mavenJava/pom-default.xml -DlocalRepositoryPath=/var/www/maven.hopper.bunnies.io"
sh "find build/libs -name Burrow\\*sources.jar | head -n 1 | xargs -I '{}' mvn install:install-file -Dfile={} -Dclassifier=sources -DpomFile=build/publications/mavenJava/pom-default.xml -DlocalRepositoryPath=/var/www/maven.hopper.bunnies.io"
sh "find build/libs -name Burrow\\*all.jar | head -n 1 | xargs -I '{}' docker build -t carrot/burrow-testnet:latest --build-arg jar={} --build-arg config=\"burrow.yaml\" ."
sh "docker rm --force burrow-testnet || true"
sh "docker run --name burrow-testnet --network=host --detach carrot/burrow-testnet:latest || true"
}
}
}
}