Skip to content

Commit a9f13f4

Browse files
committed
Applying 4.x fixes to Jenkinsfile to get build working on AWS
1 parent f921bd4 commit a9f13f4

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

Jenkinsfile

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -140,25 +140,6 @@ ${status} after ${currentBuild.durationString - ' and counting'}"""
140140
}
141141
}
142142

143-
def submitCIMetrics(buildType) {
144-
long durationMs = currentBuild.duration
145-
long durationSec = durationMs / 1000
146-
long nowSec = (currentBuild.startTimeInMillis + durationMs) / 1000
147-
def branchNameNoPeriods = env.BRANCH_NAME.replaceAll('\\.', '_')
148-
def durationMetric = "okr.ci.java.${env.DRIVER_METRIC_TYPE}.${buildType}.${branchNameNoPeriods} ${durationSec} ${nowSec}"
149-
150-
timeout(time: 1, unit: 'MINUTES') {
151-
withCredentials([string(credentialsId: 'lab-grafana-address', variable: 'LAB_GRAFANA_ADDRESS'),
152-
string(credentialsId: 'lab-grafana-port', variable: 'LAB_GRAFANA_PORT')]) {
153-
withEnv(["DURATION_METRIC=${durationMetric}"]) {
154-
sh label: 'Send runtime metrics to labgrafana', script: '''#!/bin/bash -le
155-
echo "${DURATION_METRIC}" | nc -q 5 ${LAB_GRAFANA_ADDRESS} ${LAB_GRAFANA_PORT}
156-
'''
157-
}
158-
}
159-
}
160-
}
161-
162143
def describePerCommitStage() {
163144
script {
164145
currentBuild.displayName = "Per-Commit build"
@@ -182,7 +163,9 @@ def describeAdhocAndScheduledTestingStage() {
182163

183164
// branch pattern for cron
184165
// should match 3.x, 4.x, 4.5.x, etc
185-
def branchPatternCron = ~"((\\d+(\\.[\\dx]+)+))"
166+
def branchPatternCron() {
167+
~"((\\d+(\\.[\\dx]+)+))"
168+
}
186169

187170
pipeline {
188171
agent none
@@ -327,7 +310,7 @@ pipeline {
327310

328311
triggers {
329312
// schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
330-
parameterizedCron(branchPatternCron.matcher(env.BRANCH_NAME).matches() ? """
313+
parameterizedCron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? """
331314
# Every weeknight (Monday - Friday) around 3:00 AM
332315
### JDK8 tests against 2.1, 3.0, 3.11 and 4.0
333316
H 3 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 3.11 4.0;CI_SCHEDULE_JABBA_VERSION=1.8;CI_SCHEDULE_TEST_PROFILE=long
@@ -428,11 +411,6 @@ pipeline {
428411
}
429412
}
430413
post {
431-
always {
432-
node('master') {
433-
submitCIMetrics('commit')
434-
}
435-
}
436414
aborted {
437415
notifySlack('aborted')
438416
}

0 commit comments

Comments
 (0)