elastic-apm 4.6.2 → 4.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ci/.exclude.yml +193 -0
- data/.ci/.ruby.yml +10 -0
- data/.ci/scripts/bench.sh +52 -0
- data/.ci/scripts/install-build-system.sh +5 -0
- data/.ci/snapshoty.yml +2 -3
- data/.ci/updatecli/updatecli.d/update-gherkin-specs.yml +84 -0
- data/.ci/updatecli/updatecli.d/update-json-specs.yml +84 -0
- data/.ci/updatecli/updatecli.d/update-specs.yml +86 -0
- data/.ci/updatecli/values.yml +14 -0
- data/.github/dependabot.yml +17 -1
- data/.github/workflows/README.md +58 -0
- data/.github/workflows/addToProject.yml +3 -0
- data/.github/workflows/ci-docs.yml +20 -0
- data/.github/workflows/ci.yml +70 -0
- data/.github/workflows/coverage-reporter.yml +34 -0
- data/.github/workflows/labeler.yml +5 -0
- data/.github/workflows/microbenchmark.yml +48 -0
- data/.github/workflows/opentelemetry.yml +22 -0
- data/.github/workflows/release.yml +71 -0
- data/.github/workflows/run-matrix.yml +59 -0
- data/.github/workflows/snapshoty.yml +35 -0
- data/.github/workflows/test-reporter.yml +24 -0
- data/.github/workflows/{update-specs.yml → updatecli.yml} +3 -4
- data/.pre-commit-config.yaml +0 -2
- data/CHANGELOG.asciidoc +39 -0
- data/Gemfile +16 -3
- data/README.md +1 -1
- data/bench/rubyprof.rb +1 -0
- data/bin/run-tests +10 -1
- data/docker-compose.yml +4 -1
- data/docs/configuration.asciidoc +6 -5
- data/docs/index.asciidoc +2 -2
- data/docs/{log-correlation.asciidoc → logs.asciidoc} +29 -2
- data/docs/opentracing.asciidoc +1 -1
- data/docs/redirects.asciidoc +9 -0
- data/lib/elastic_apm/context_builder.rb +10 -5
- data/lib/elastic_apm/metadata/cloud_info.rb +9 -7
- data/lib/elastic_apm/metrics.rb +24 -20
- data/lib/elastic_apm/span_helpers.rb +6 -6
- data/lib/elastic_apm/spies/action_dispatch.rb +11 -3
- data/lib/elastic_apm/spies/faraday.rb +8 -1
- data/lib/elastic_apm/version.rb +1 -1
- metadata +26 -19
- data/.ci/.jenkins_exclude.yml +0 -191
- data/.ci/.jenkins_ruby.yml +0 -10
- data/.ci/.jenkins_ruby_benchmarks.yml +0 -6
- data/.ci/Jenkinsfile +0 -450
- data/.ci/jobs/apm-agent-ruby-downstream.yml +0 -38
- data/.ci/jobs/apm-agent-ruby-linting-mbp.yml +0 -39
- data/.ci/jobs/apm-agent-ruby-mbp.yml +0 -43
- data/.ci/jobs/apm-agent-ruby.yml +0 -4
- data/.ci/jobs/defaults.yml +0 -24
- data/.ci/linting.groovy +0 -32
- data/.ci/packer_cache.sh +0 -16
- data/.ci/update-specs.yml +0 -108
- /data/.ci/{.jenkins_codecov.yml → .codecov.yml} +0 -0
- /data/.ci/{.jenkins_framework.yml → .framework.yml} +0 -0
- /data/.ci/{.jenkins_main_framework.yml → .main_framework.yml} +0 -0
data/.ci/Jenkinsfile
DELETED
@@ -1,450 +0,0 @@
|
|
1
|
-
#!/usr/bin/env groovy
|
2
|
-
@Library('apm@current') _
|
3
|
-
|
4
|
-
import co.elastic.matrix.*
|
5
|
-
import groovy.transform.Field
|
6
|
-
|
7
|
-
/**
|
8
|
-
This is the parallel tasks generator,
|
9
|
-
it is need as field to store the results of the tests.
|
10
|
-
*/
|
11
|
-
@Field def rubyTasksGen
|
12
|
-
|
13
|
-
pipeline {
|
14
|
-
agent { label 'linux && immutable' }
|
15
|
-
environment {
|
16
|
-
REPO = 'apm-agent-ruby'
|
17
|
-
BASE_DIR = "src/github.com/elastic/${env.REPO}"
|
18
|
-
PIPELINE_LOG_LEVEL = 'INFO'
|
19
|
-
NOTIFY_TO = credentials('notify-to')
|
20
|
-
JOB_GCS_BUCKET = credentials('gcs-bucket')
|
21
|
-
CODECOV_SECRET = 'secret/apm-team/ci/apm-agent-ruby-codecov'
|
22
|
-
DOCKER_REGISTRY = 'docker.elastic.co'
|
23
|
-
DOCKER_SECRET = 'secret/apm-team/ci/docker-registry/prod'
|
24
|
-
RELEASE_SECRET = 'secret/apm-team/ci/apm-agent-ruby-rubygems-release'
|
25
|
-
OPBEANS_REPO = 'opbeans-ruby'
|
26
|
-
REFERENCE_REPO = '/var/lib/jenkins/.git-references/apm-agent-ruby.git'
|
27
|
-
SLACK_CHANNEL = '#apm-agent-ruby'
|
28
|
-
RUBY_DOCKER_TAG = 'ruby:2.6'
|
29
|
-
}
|
30
|
-
options {
|
31
|
-
timeout(time: 2, unit: 'HOURS')
|
32
|
-
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
|
33
|
-
timestamps()
|
34
|
-
ansiColor('xterm')
|
35
|
-
disableResume()
|
36
|
-
durabilityHint('PERFORMANCE_OPTIMIZED')
|
37
|
-
rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true])
|
38
|
-
quietPeriod(10)
|
39
|
-
}
|
40
|
-
triggers {
|
41
|
-
issueCommentTrigger("(${obltGitHubComments()}|^run benchmark tests)")
|
42
|
-
}
|
43
|
-
parameters {
|
44
|
-
booleanParam(name: 'Run_As_Main_Branch', defaultValue: false, description: 'Allow to run any steps on a PR, some steps normally only run on main branch.')
|
45
|
-
booleanParam(name: 'bench_ci', defaultValue: true, description: 'Enable run benchmarks.')
|
46
|
-
}
|
47
|
-
stages {
|
48
|
-
/**
|
49
|
-
Checkout the code and stash it, to use it on other stages.
|
50
|
-
*/
|
51
|
-
stage('Checkout') {
|
52
|
-
options { skipDefaultCheckout() }
|
53
|
-
steps {
|
54
|
-
pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ])
|
55
|
-
deleteDir()
|
56
|
-
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true, reference: "${env.REFERENCE_REPO}")
|
57
|
-
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
|
58
|
-
script {
|
59
|
-
dir("${BASE_DIR}"){
|
60
|
-
// Skip all the stages except docs for PR's with asciidoc and md changes only
|
61
|
-
env.ONLY_DOCS = isGitRegionMatch(patterns: [ '.*\\.(asciidoc|md)' ], shouldMatchAll: true)
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
66
|
-
stage('Sanity checks') {
|
67
|
-
when {
|
68
|
-
beforeAgent true
|
69
|
-
allOf {
|
70
|
-
expression { return env.ONLY_DOCS == "false" }
|
71
|
-
anyOf {
|
72
|
-
not { changeRequest() }
|
73
|
-
expression { return params.Run_As_Main_Branch }
|
74
|
-
}
|
75
|
-
}
|
76
|
-
}
|
77
|
-
options { skipDefaultCheckout() }
|
78
|
-
environment {
|
79
|
-
HOME = "${env.WORKSPACE}"
|
80
|
-
PATH = "${env.WORKSPACE}/bin:${env.PATH}"
|
81
|
-
}
|
82
|
-
steps {
|
83
|
-
withGithubNotify(context: 'Sanity checks') {
|
84
|
-
deleteDir()
|
85
|
-
unstash 'source'
|
86
|
-
dir(BASE_DIR) {
|
87
|
-
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE', message: 'Sanity checks failed but keep running the build') {
|
88
|
-
preCommit(commit: "${GIT_BASE_COMMIT}", junit: true)
|
89
|
-
}
|
90
|
-
}
|
91
|
-
}
|
92
|
-
}
|
93
|
-
}
|
94
|
-
/**
|
95
|
-
Execute unit tests.
|
96
|
-
*/
|
97
|
-
stage('Tests') {
|
98
|
-
when {
|
99
|
-
beforeAgent true
|
100
|
-
expression { return env.ONLY_DOCS == "false" }
|
101
|
-
}
|
102
|
-
failFast false
|
103
|
-
parallel {
|
104
|
-
stage('Tests') {
|
105
|
-
options { skipDefaultCheckout() }
|
106
|
-
steps {
|
107
|
-
withGithubNotify(context: 'Tests', tab: 'tests') {
|
108
|
-
runTests('.ci/.jenkins_framework.yml')
|
109
|
-
}
|
110
|
-
}
|
111
|
-
post {
|
112
|
-
always {
|
113
|
-
convergeCoverage()
|
114
|
-
}
|
115
|
-
}
|
116
|
-
}
|
117
|
-
stage('Main Tests frameworks') {
|
118
|
-
options { skipDefaultCheckout() }
|
119
|
-
steps {
|
120
|
-
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE', message: "The tests for the main framework have failed. Let's warn instead.") {
|
121
|
-
runTests('.ci/.jenkins_main_framework.yml')
|
122
|
-
}
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
}
|
127
|
-
stage('Publish snapshot packages') {
|
128
|
-
options { skipDefaultCheckout() }
|
129
|
-
environment {
|
130
|
-
PATH = "${env.WORKSPACE}/.local/bin:${env.WORKSPACE}/bin:${env.PATH}"
|
131
|
-
BUCKET_NAME = 'oblt-artifacts'
|
132
|
-
DOCKER_REGISTRY = 'docker.elastic.co'
|
133
|
-
DOCKER_REGISTRY_SECRET = 'secret/observability-team/ci/docker-registry/prod'
|
134
|
-
GCS_ACCOUNT_SECRET = 'secret/observability-team/ci/snapshoty'
|
135
|
-
}
|
136
|
-
when { branch 'main' }
|
137
|
-
steps {
|
138
|
-
withGithubNotify(context: 'Publish snapshot packages') {
|
139
|
-
deleteDir()
|
140
|
-
unstash 'source'
|
141
|
-
dir(env.BASE_DIR) {
|
142
|
-
script {
|
143
|
-
docker.image(env.RUBY_DOCKER_TAG).inside() {
|
144
|
-
sh(label: 'install build system', script: 'gem install rake yard rspec')
|
145
|
-
sh(label: 'create gem', script: 'rake build')
|
146
|
-
}
|
147
|
-
snapshoty(
|
148
|
-
bucket: env.BUCKET_NAME,
|
149
|
-
gcsAccountSecret: env.GCS_ACCOUNT_SECRET,
|
150
|
-
dockerRegistry: env.DOCKER_REGISTRY,
|
151
|
-
dockerSecret: env.DOCKER_REGISTRY_SECRET
|
152
|
-
)
|
153
|
-
}
|
154
|
-
}
|
155
|
-
}
|
156
|
-
}
|
157
|
-
}
|
158
|
-
stage('Benchmarks') {
|
159
|
-
options { skipDefaultCheckout() }
|
160
|
-
when {
|
161
|
-
beforeAgent true
|
162
|
-
allOf {
|
163
|
-
anyOf {
|
164
|
-
branch 'main'
|
165
|
-
branch "\\d+\\.\\d+"
|
166
|
-
branch "v\\d?"
|
167
|
-
tag pattern: 'v\\d+.*', comparator: "REGEXP"
|
168
|
-
expression { return params.Run_As_Main_Branch }
|
169
|
-
expression { return env.GITHUB_COMMENT?.contains('benchmark tests') }
|
170
|
-
}
|
171
|
-
expression { return params.bench_ci }
|
172
|
-
}
|
173
|
-
}
|
174
|
-
stages {
|
175
|
-
stage('Clean Workspace') {
|
176
|
-
agent { label 'microbenchmarks-pool' }
|
177
|
-
steps {
|
178
|
-
echo "Cleaning Workspace"
|
179
|
-
}
|
180
|
-
post {
|
181
|
-
always {
|
182
|
-
cleanWs(notFailBuild: true)
|
183
|
-
}
|
184
|
-
}
|
185
|
-
}
|
186
|
-
/**
|
187
|
-
Run the benchmarks and store the results on ES.
|
188
|
-
The result JSON files are also archive into Jenkins.
|
189
|
-
*/
|
190
|
-
stage('Run Benchmarks') {
|
191
|
-
steps {
|
192
|
-
withGithubNotify(context: 'Run Benchmarks') {
|
193
|
-
deleteDir()
|
194
|
-
unstash 'source'
|
195
|
-
dir("${BASE_DIR}"){
|
196
|
-
script {
|
197
|
-
def versions = readYaml(file: ".ci/.jenkins_ruby_benchmarks.yml")
|
198
|
-
def benchmarkTask = [:]
|
199
|
-
versions['RUBY_VERSION'].each{ v ->
|
200
|
-
benchmarkTask[v] = runBenchmark(v)
|
201
|
-
}
|
202
|
-
parallel(benchmarkTask)
|
203
|
-
}
|
204
|
-
}
|
205
|
-
}
|
206
|
-
}
|
207
|
-
}
|
208
|
-
}
|
209
|
-
}
|
210
|
-
stage('Release') {
|
211
|
-
options { skipDefaultCheckout() }
|
212
|
-
environment {
|
213
|
-
HOME = '/var/lib/jenkins'
|
214
|
-
}
|
215
|
-
when {
|
216
|
-
beforeAgent true
|
217
|
-
tag pattern: 'v\\d+.*', comparator: 'REGEXP'
|
218
|
-
}
|
219
|
-
stages {
|
220
|
-
stage('Notify') {
|
221
|
-
steps {
|
222
|
-
notifyStatus(slackStatus: 'warning', subject: "[${env.REPO}] Release *${env.TAG_NAME}* ready to be pushed",
|
223
|
-
body: "(<${env.RUN_DISPLAY_URL}|Open>).\n Changes: ${env.TAG_NAME}")
|
224
|
-
}
|
225
|
-
}
|
226
|
-
stage('Release') {
|
227
|
-
steps {
|
228
|
-
deleteDir()
|
229
|
-
unstash 'source'
|
230
|
-
prepareRelease(){
|
231
|
-
sh 'rake release'
|
232
|
-
}
|
233
|
-
}
|
234
|
-
}
|
235
|
-
stage('Update Branch') {
|
236
|
-
steps {
|
237
|
-
deleteDir()
|
238
|
-
unstash 'source'
|
239
|
-
prepareRelease(){
|
240
|
-
catchError(buildResult: 'SUCCESS', message: 'Update branch task failed', stageResult: 'UNSTABLE') {
|
241
|
-
sh 'rake release:update_branch'
|
242
|
-
}
|
243
|
-
}
|
244
|
-
}
|
245
|
-
post {
|
246
|
-
success {
|
247
|
-
notifyStatus(slackStatus: 'good', subject: "[${env.REPO}] Release *${env.TAG_NAME}* published",
|
248
|
-
body: "Great news, the release has been done successfully. (<${env.RUN_DISPLAY_URL}|Open>).")
|
249
|
-
}
|
250
|
-
unsuccessful {
|
251
|
-
notifyStatus(slackStatus: 'warning', subject: "[${env.REPO}] Release *${env.TAG_NAME}* has some sync-up post-release failures.",
|
252
|
-
body: "Please go to ${env.BUILD_URL} to review the logs. Most likely you need to update the branch manually. (<${env.RUN_DISPLAY_URL}|Open>)")
|
253
|
-
}
|
254
|
-
}
|
255
|
-
}
|
256
|
-
stage('Opbeans') {
|
257
|
-
environment {
|
258
|
-
REPO_NAME = "${OPBEANS_REPO}"
|
259
|
-
VERSION = "${env.BRANCH_NAME.replaceAll('^v', '')}"
|
260
|
-
}
|
261
|
-
steps {
|
262
|
-
deleteDir()
|
263
|
-
// Let's wait for the Gem to be available
|
264
|
-
sh label: 'Wait for gem', script: """#!/usr/bin/env bash
|
265
|
-
source /usr/local/bin/bash_standard_lib.sh
|
266
|
-
(retry 10 curl --silent --show-error --fail -I https://rubygems.org/gems/elastic-apm/versions/${env.VERSION})
|
267
|
-
"""
|
268
|
-
dir("${OPBEANS_REPO}"){
|
269
|
-
git(credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
|
270
|
-
url: "git@github.com:elastic/${OPBEANS_REPO}.git",
|
271
|
-
branch: 'main')
|
272
|
-
// It's required to transform the tag value to the gem version
|
273
|
-
sh script: ".ci/bump-version.sh ${env.VERSION}", label: 'Bump version'
|
274
|
-
// The opbeans pipeline will trigger a release for the main branch
|
275
|
-
gitPush()
|
276
|
-
// The opbeans pipeline will trigger a release for the release tag
|
277
|
-
gitCreateTag(tag: "${env.BRANCH_NAME}")
|
278
|
-
}
|
279
|
-
}
|
280
|
-
}
|
281
|
-
}
|
282
|
-
}
|
283
|
-
}
|
284
|
-
post {
|
285
|
-
cleanup {
|
286
|
-
notifyBuildResult()
|
287
|
-
}
|
288
|
-
}
|
289
|
-
}
|
290
|
-
|
291
|
-
/**
|
292
|
-
Run benchmarks for a Ruby version, then report the results to the Elasticsearch server.
|
293
|
-
*/
|
294
|
-
def runBenchmark(version){
|
295
|
-
return {
|
296
|
-
node('microbenchmarks-pool'){
|
297
|
-
// Transform the versions like:
|
298
|
-
// - docker.elastic.co/observability-ci/jruby:9.2-12-jdk to jruby-9.2-12-jdk
|
299
|
-
// - jruby:9.1 to jruby-9.1
|
300
|
-
def transformedVersion = version.replaceAll('.*/', '').replaceAll(':', '-')
|
301
|
-
withEnv(["HOME=${env.WORKSPACE}/${transformedVersion}"]){
|
302
|
-
dir("${transformedVersion}"){
|
303
|
-
deleteDir()
|
304
|
-
unstash 'source'
|
305
|
-
dir("${BASE_DIR}"){
|
306
|
-
retry(2){
|
307
|
-
sleep randomNumber(min:10, max: 30)
|
308
|
-
dockerLogin(secret: "${DOCKER_SECRET}", registry: "${DOCKER_REGISTRY}")
|
309
|
-
}
|
310
|
-
try{
|
311
|
-
sh """./spec/scripts/benchmarks.sh "${version}" "${REFERENCE_REPO}" """
|
312
|
-
} finally {
|
313
|
-
archiveArtifacts(
|
314
|
-
allowEmptyArchive: true,
|
315
|
-
artifacts: "**/benchmark-${transformedVersion}.raw,**/benchmark-${transformedVersion}.error",
|
316
|
-
onlyIfSuccessful: false)
|
317
|
-
sendBenchmarks(file: "benchmark-${transformedVersion}.bulk",
|
318
|
-
index: "benchmark-ruby", archive: true)
|
319
|
-
cleanWs(notFailBuild: true)
|
320
|
-
}
|
321
|
-
}
|
322
|
-
}
|
323
|
-
}
|
324
|
-
}
|
325
|
-
}
|
326
|
-
}
|
327
|
-
|
328
|
-
class RubyParallelTaskGenerator extends DefaultParallelTaskGenerator {
|
329
|
-
|
330
|
-
public RubyParallelTaskGenerator(Map params){
|
331
|
-
super(params)
|
332
|
-
}
|
333
|
-
|
334
|
-
/**
|
335
|
-
build a clousure that launch and agent and execute the corresponding test script,
|
336
|
-
then store the results.
|
337
|
-
*/
|
338
|
-
public Closure generateStep(x, y){
|
339
|
-
return {
|
340
|
-
steps.sleep steps.randomNumber(min:10, max: 30)
|
341
|
-
steps.node('linux && immutable'){
|
342
|
-
// Label is transformed to avoid using the internal docker registry in the x coordinate
|
343
|
-
// TODO: def label = "${tag}:${x?.drop(x?.lastIndexOf('/')+1)}#${y}"
|
344
|
-
def label = "${tag}:${x}#${y}"
|
345
|
-
try {
|
346
|
-
steps.runScript(label: label, ruby: x, framework: y)
|
347
|
-
saveResult(x, y, 1)
|
348
|
-
} catch(e){
|
349
|
-
saveResult(x, y, 0)
|
350
|
-
steps.error("${label} tests failed : ${e.toString()}\n")
|
351
|
-
} finally {
|
352
|
-
steps.junit(allowEmptyResults: false,
|
353
|
-
keepLongStdio: true,
|
354
|
-
testResults: "**/spec/junit-reports/**/ruby-agent-junit.xml")
|
355
|
-
steps.dir("${steps.env.BASE_DIR}"){
|
356
|
-
steps.archiveArtifacts(artifacts: 'coverage/matrix_results/', defaultExcludes: false)
|
357
|
-
steps.stash(name: steps.normalise("coverage-${x}-${y}"), includes: 'coverage/matrix_results/', allowEmpty: true)
|
358
|
-
}
|
359
|
-
}
|
360
|
-
}
|
361
|
-
}
|
362
|
-
}
|
363
|
-
}
|
364
|
-
|
365
|
-
/**
|
366
|
-
Run all the tests for the given file with the frameworks to test
|
367
|
-
*/
|
368
|
-
def runTests(frameworkFile) {
|
369
|
-
deleteDir()
|
370
|
-
unstash "source"
|
371
|
-
dir("${BASE_DIR}"){
|
372
|
-
rubyTasksGen = new RubyParallelTaskGenerator(
|
373
|
-
xKey: 'RUBY_VERSION',
|
374
|
-
yKey: 'FRAMEWORK',
|
375
|
-
xFile: ".ci/.jenkins_ruby.yml",
|
376
|
-
yFile: frameworkFile,
|
377
|
-
exclusionFile: ".ci/.jenkins_exclude.yml",
|
378
|
-
tag: "Ruby",
|
379
|
-
name: "Ruby",
|
380
|
-
steps: this
|
381
|
-
)
|
382
|
-
def testTasks = rubyTasksGen.generateParallelTests()
|
383
|
-
parallel(testTasks)
|
384
|
-
}
|
385
|
-
}
|
386
|
-
|
387
|
-
/**
|
388
|
-
Run tests for a Ruby version and framework version.
|
389
|
-
*/
|
390
|
-
def runScript(Map params = [:]){
|
391
|
-
def label = params.label
|
392
|
-
def ruby = params.ruby
|
393
|
-
def framework = params.framework
|
394
|
-
log(level: 'INFO', text: "${label}")
|
395
|
-
retry(2){
|
396
|
-
withEnv(["HOME=${env.WORKSPACE}", "PATH=${env.PATH}:${env.WORKSPACE}/bin"]) {
|
397
|
-
deleteDir()
|
398
|
-
unstash 'source'
|
399
|
-
dir("${BASE_DIR}"){
|
400
|
-
sleep randomNumber(min:10, max: 30)
|
401
|
-
dockerLogin(secret: "${DOCKER_SECRET}", registry: "${DOCKER_REGISTRY}")
|
402
|
-
sh(label: "Run BDD tests", script: "./spec/scripts/features.sh ${ruby}")
|
403
|
-
sh("./spec/scripts/spec.sh ${ruby} ${framework}")
|
404
|
-
}
|
405
|
-
}
|
406
|
-
}
|
407
|
-
}
|
408
|
-
|
409
|
-
def convergeCoverage() {
|
410
|
-
deleteDir()
|
411
|
-
unstash('source')
|
412
|
-
dir("${BASE_DIR}"){
|
413
|
-
rubyTasksGen.dumpMatrix('-')?.each {
|
414
|
-
unstash(normalise("coverage-${it}"))
|
415
|
-
}
|
416
|
-
sh(script: './spec/scripts/coverage_converge.sh')
|
417
|
-
cobertura coberturaReportFile: 'coverage/coverage.xml', onlyStable: false
|
418
|
-
}
|
419
|
-
}
|
420
|
-
|
421
|
-
def prepareRelease(Closure body){
|
422
|
-
dir("${env.BASE_DIR}"){
|
423
|
-
docker.image(env.RUBY_DOCKER_TAG).inside('-v ${REFERENCE_REPO}:${REFERENCE_REPO} -v /etc/passwd:/etc/passwd -v ${HOME}/.ssh:${HOME}/.ssh') {
|
424
|
-
withEnv(["HOME=${env.WORKSPACE}/${env.BASE_DIR ?: ''}"]) {
|
425
|
-
rubygemsLogin.withApi(secret: "${env.RELEASE_SECRET}") {
|
426
|
-
withGitRelease(credentialsId: '2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken') {
|
427
|
-
sh 'gem install rake yard rspec'
|
428
|
-
body()
|
429
|
-
}
|
430
|
-
}
|
431
|
-
}
|
432
|
-
}
|
433
|
-
}
|
434
|
-
}
|
435
|
-
|
436
|
-
// Transform the versions like:
|
437
|
-
// - docker.elastic.co/observability-ci/jruby:9.2-12-jdk to jruby-9.2-12-jdk
|
438
|
-
// - jruby:9.1 to jruby-9.1
|
439
|
-
def normalise(def what) {
|
440
|
-
return what.replaceAll('.*/', '').replaceAll(':', '-')
|
441
|
-
}
|
442
|
-
|
443
|
-
def notifyStatus(def args = [:]) {
|
444
|
-
releaseNotification(slackChannel: "${env.SLACK_CHANNEL}",
|
445
|
-
slackColor: args.slackStatus,
|
446
|
-
slackCredentialsId: 'jenkins-slack-integration-token',
|
447
|
-
to: "${env.NOTIFY_TO}",
|
448
|
-
subject: args.subject,
|
449
|
-
body: args.body)
|
450
|
-
}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- job:
|
3
|
-
name: apm-agent-ruby/apm-agent-ruby-downstream
|
4
|
-
display-name: APM Agent Ruby Downstream
|
5
|
-
description: APM Agent Ruby Downstream .
|
6
|
-
script-path: .ci/downstreamTests.groovy
|
7
|
-
scm:
|
8
|
-
- github:
|
9
|
-
branch-discovery: no-pr
|
10
|
-
discover-pr-forks-strategy: merge-current
|
11
|
-
discover-pr-forks-trust: permission
|
12
|
-
discover-pr-origin: merge-current
|
13
|
-
discover-tags: true
|
14
|
-
notification-context: 'apm-ci/downstream'
|
15
|
-
property-strategies:
|
16
|
-
all-branches:
|
17
|
-
- suppress-scm-triggering: true
|
18
|
-
repo: apm-agent-ruby
|
19
|
-
repo-owner: elastic
|
20
|
-
credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken
|
21
|
-
ssh-checkout:
|
22
|
-
credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba
|
23
|
-
clean:
|
24
|
-
after: true
|
25
|
-
before: true
|
26
|
-
prune: true
|
27
|
-
shallow-clone: true
|
28
|
-
depth: 3
|
29
|
-
do-not-fetch-tags: true
|
30
|
-
submodule:
|
31
|
-
disable: false
|
32
|
-
recursive: true
|
33
|
-
parent-credentials: true
|
34
|
-
timeout: 100
|
35
|
-
reference-repo: /var/lib/jenkins/.git-references/apm-agent-ruby.git
|
36
|
-
timeout: '15'
|
37
|
-
use-author: true
|
38
|
-
wipe-workspace: 'True'
|
@@ -1,39 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- job:
|
3
|
-
name: apm-agent-ruby/apm-agent-ruby-linting-mbp
|
4
|
-
display-name: APM Agent Ruby Linting
|
5
|
-
description: APM Agent Ruby Linting
|
6
|
-
script-path: .ci/linting.groovy
|
7
|
-
scm:
|
8
|
-
- github:
|
9
|
-
branch-discovery: no-pr
|
10
|
-
discover-pr-forks-strategy: merge-current
|
11
|
-
discover-pr-forks-trust: permission
|
12
|
-
discover-pr-origin: merge-current
|
13
|
-
discover-tags: false
|
14
|
-
notification-context: 'apm-ci/linting'
|
15
|
-
head-filter-regex: '^PR-.*$'
|
16
|
-
repo: apm-agent-ruby
|
17
|
-
repo-owner: elastic
|
18
|
-
credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken
|
19
|
-
ssh-checkout:
|
20
|
-
credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba
|
21
|
-
build-strategies:
|
22
|
-
- change-request:
|
23
|
-
ignore-target-only-changes: false
|
24
|
-
clean:
|
25
|
-
after: true
|
26
|
-
before: true
|
27
|
-
prune: true
|
28
|
-
shallow-clone: true
|
29
|
-
depth: 3
|
30
|
-
do-not-fetch-tags: true
|
31
|
-
submodule:
|
32
|
-
disable: false
|
33
|
-
recursive: true
|
34
|
-
parent-credentials: true
|
35
|
-
timeout: 100
|
36
|
-
reference-repo: /var/lib/jenkins/.git-references/apm-agent-ruby.git
|
37
|
-
timeout: '15'
|
38
|
-
use-author: true
|
39
|
-
wipe-workspace: 'True'
|
@@ -1,43 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- job:
|
3
|
-
name: apm-agent-ruby/apm-agent-ruby-mbp
|
4
|
-
display-name: APM Agent Ruby
|
5
|
-
description: APM Agent Ruby
|
6
|
-
script-path: .ci/Jenkinsfile
|
7
|
-
scm:
|
8
|
-
- github:
|
9
|
-
branch-discovery: no-pr
|
10
|
-
discover-pr-forks-strategy: merge-current
|
11
|
-
discover-pr-forks-trust: permission
|
12
|
-
discover-pr-origin: merge-current
|
13
|
-
discover-tags: true
|
14
|
-
notification-context: 'apm-ci'
|
15
|
-
repo: apm-agent-ruby
|
16
|
-
repo-owner: elastic
|
17
|
-
credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken
|
18
|
-
head-filter-regex: '^(main|PR-.*|[3-9]\.x|v4\.[5-9]+.*|v[5-9]+.*)$'
|
19
|
-
ssh-checkout:
|
20
|
-
credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba
|
21
|
-
build-strategies:
|
22
|
-
- tags:
|
23
|
-
ignore-tags-older-than: -1
|
24
|
-
ignore-tags-newer-than: -1
|
25
|
-
- regular-branches: true
|
26
|
-
- change-request:
|
27
|
-
ignore-target-only-changes: false
|
28
|
-
clean:
|
29
|
-
after: true
|
30
|
-
before: true
|
31
|
-
prune: true
|
32
|
-
shallow-clone: true
|
33
|
-
depth: 3
|
34
|
-
do-not-fetch-tags: true
|
35
|
-
submodule:
|
36
|
-
disable: false
|
37
|
-
recursive: true
|
38
|
-
parent-credentials: true
|
39
|
-
timeout: 100
|
40
|
-
reference-repo: /var/lib/jenkins/.git-references/apm-agent-ruby.git
|
41
|
-
timeout: '15'
|
42
|
-
use-author: true
|
43
|
-
wipe-workspace: 'True'
|
data/.ci/jobs/apm-agent-ruby.yml
DELETED
data/.ci/jobs/defaults.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
##### GLOBAL METADATA
|
4
|
-
|
5
|
-
- meta:
|
6
|
-
cluster: apm-ci
|
7
|
-
|
8
|
-
##### JOB DEFAULTS
|
9
|
-
|
10
|
-
- job:
|
11
|
-
view: APM-CI
|
12
|
-
project-type: multibranch
|
13
|
-
logrotate:
|
14
|
-
daysToKeep: 30
|
15
|
-
numToKeep: 300
|
16
|
-
number-to-keep: '100'
|
17
|
-
days-to-keep: '30'
|
18
|
-
concurrent: true
|
19
|
-
node: linux
|
20
|
-
periodic-folder-trigger: 1w
|
21
|
-
prune-dead-branches: true
|
22
|
-
publishers:
|
23
|
-
- email:
|
24
|
-
recipients: infra-root+build@elastic.co
|
data/.ci/linting.groovy
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
#!/usr/bin/env groovy
|
2
|
-
@Library('apm@current') _
|
3
|
-
|
4
|
-
pipeline {
|
5
|
-
agent { label 'docker && linux && immutable' }
|
6
|
-
options {
|
7
|
-
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
|
8
|
-
timestamps()
|
9
|
-
ansiColor('xterm')
|
10
|
-
disableResume()
|
11
|
-
durabilityHint('PERFORMANCE_OPTIMIZED')
|
12
|
-
rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true])
|
13
|
-
quietPeriod(10)
|
14
|
-
}
|
15
|
-
triggers {
|
16
|
-
issueCommentTrigger('(?i).*(?:jenkins\\W+)?run\\W+(?:the\\W+)?linters(?:\\W+please)?.*')
|
17
|
-
}
|
18
|
-
stages {
|
19
|
-
stage('Sanity checks') {
|
20
|
-
environment {
|
21
|
-
HOME = "${env.WORKSPACE}"
|
22
|
-
PATH = "${env.WORKSPACE}/bin:${env.PATH}"
|
23
|
-
}
|
24
|
-
steps {
|
25
|
-
script {
|
26
|
-
def sha = getGitCommitSha()
|
27
|
-
preCommit(commit: "${sha}", junit: true)
|
28
|
-
}
|
29
|
-
}
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
data/.ci/packer_cache.sh
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
source /usr/local/bin/bash_standard_lib.sh
|
4
|
-
|
5
|
-
if [ -x "$(command -v docker)" ]; then
|
6
|
-
grep "-" .ci/.jenkins_ruby.yml | grep -v 'observability-ci' | cut -d'-' -f2- | \
|
7
|
-
while read -r version;
|
8
|
-
do
|
9
|
-
transformedName=${version/:/-}
|
10
|
-
transformedVersion=$(echo "${version}" | cut -d":" -f2)
|
11
|
-
imageName="apm-agent-ruby"
|
12
|
-
registryImageName="docker.elastic.co/observability-ci/${imageName}:${transformedName}"
|
13
|
-
(retry 2 docker pull "${registryImageName}")
|
14
|
-
docker tag "${registryImageName}" "${imageName}:${transformedVersion}"
|
15
|
-
done
|
16
|
-
fi
|