-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile.micrometer
54 lines (54 loc) · 2.01 KB
/
Jenkinsfile.micrometer
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
#!groovy
pipeline {
agent { node { label 'linux' } }
environment{
GRADLE_HOME = fileExists "$HOME/.gradle"
}
options {
buildDiscarder logRotator( numToKeepStr: '20' )
}
parameters {
string( defaultValue: '12.0.7', description: 'Jetty version to use to build micrometer project',
name: 'JETTY_VERSION' )
string( defaultValue: 'jdk17', description: 'JDK to use (jdk8,jdk11,jdk16)', name: 'JDK' )
string( defaultValue: 'main', description: 'spring-framework branch', name: 'MICROMETER_BRANCH' )
string( defaultValue: 'micrometer-metrics', description: 'micrometer-metrics github org', name: 'MICROMETER_ORG' )
}
stages {
stage('Create Gradle home'){
when { expression { GRADLE_HOME == 'false' } }
steps {
sh "mkdir $HOME/.gradle"
}
}
stage("Checkout Micrometer"){
steps{
stash name: 'init.gradle.spring-framework', includes: 'init.gradle.spring-framework'
checkout([$class: 'GitSCM',
branches: [[name: "*/$MICROMETER_BRANCH"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/$MICROMETER_ORG/micrometer.git']]])
}
}
stage("Build Micrometer"){
steps{
withEnv( ["JAVA_HOME=${tool "$jdk"}", "PATH+GRADLE=${tool '6.4'}"] ) {
configFileProvider([configFile(fileId: 'init.gradle', variable: 'INIT_GRADLE')]) {
sh "cp $INIT_GRADLE $HOME/.gradle/init.gradle"
sh 'ls -lrt'
sh 'cat gradle/libs.versions.toml'
sh './gradlew build --info --no-daemon --no-build-cache ' // --continue --init-script init.gradle.spring-framework.modified'
}
}
}
post {
always {
script{
currentBuild.description = "Build SpringFramework branch ${MICROMETER_BRANCH}, Jetty Version ${JETTY_VERSION}, jdk ${jdk}"
}
junit '**/build/test-results/test/*.xml'
}
}
}
}
}