Skip to content

Commit 5867081

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/ci-pipeline-2.0
* upstream/master: (29 commits) Add an explicit system test for processes on unix systems (elastic#20320) [Autodiscovery] Ignore ErrInputNotFinished errors in autodiscover config checks (elastic#20305) [CI] Update README.md with CI references (elastic#20316) Add ECK doc links to Heartbeat docs (elastic#20284) [Filebeat] Add export tests to x-pack/filebeat (elastic#20156) feat(ci): support building docker images for PRs (elastic#20323) Update system tests dependency (elastic#20287) [Libbeat] Log debug message if the Kibana dashboard can not be imported from the archive (elastic#12211) (elastic#20150) [Filebeat][Gsuite] Transform all dates to timestamp with processor (elastic#20308) Infer types in Prometheus remote_write (elastic#19944) Remove unnecessary restarts of metricsets while using Node autodiscover (elastic#19974) docs: update changelog on master branch (elastic#20259) feat(ci): support storing artifacts for PRs in separate dirs (elastic#20282) [CI] Change upstream reference (elastic#20296) [Filebeat] Updates to Suricata module (elastic#20220) [docs] Fix Windows download link for agent (elastic#20258) [docs] Rename release highlights to what's new (elastic#20255) fix: update the display name of the multibranch job (elastic#20265) [Elastic Agent] Add basic protocol to control Elastic Agent. (elastic#20146) Cisco ASA: Fix message 106100 (elastic#20245) ...
2 parents aa672c3 + 6106a0e commit 5867081

File tree

110 files changed

+6508
-1442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+6508
-1442
lines changed

.ci/apm-beats-update.groovy

+43-41
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pipeline {
2727
}
2828
triggers {
2929
issueCommentTrigger('(?i).*/run\\s+(?:apm-beats-update\\W+)?.*')
30-
upstream("Beats/beats-beats-mbp/${ env.JOB_BASE_NAME.startsWith('PR-') ? 'none' : env.JOB_BASE_NAME }")
30+
upstream("Beats/beats/${ env.JOB_BASE_NAME.startsWith('PR-') ? 'none' : env.JOB_BASE_NAME }")
3131
}
3232
stages {
3333
stage('Filter build') {
@@ -48,51 +48,53 @@ pipeline {
4848
}
4949
}
5050
}
51-
/**
52-
Checkout the code and stash it, to use it on other stages.
53-
*/
54-
stage('Checkout') {
55-
steps {
56-
deleteDir()
57-
gitCheckout(basedir: "${BEATS_DIR}", githubNotifyFirstTimeContributor: false)
58-
script {
59-
dir("${BEATS_DIR}"){
60-
env.GO_VERSION = readFile(".go-version").trim()
61-
def regexps =[
62-
"^devtools/mage.*",
63-
"^libbeat/scripts/Makefile",
64-
]
65-
env.BEATS_UPDATED = isGitRegionMatch(patterns: regexps)
66-
// Skip all the stages except docs for PR's with asciidoc changes only
67-
env.ONLY_DOCS = isGitRegionMatch(patterns: [ '.*\\.asciidoc' ], comparator: 'regexp', shouldMatchAll: true)
51+
stages {
52+
/**
53+
Checkout the code and stash it, to use it on other stages.
54+
*/
55+
stage('Checkout') {
56+
steps {
57+
deleteDir()
58+
gitCheckout(basedir: "${BEATS_DIR}", githubNotifyFirstTimeContributor: false)
59+
script {
60+
dir("${BEATS_DIR}"){
61+
env.GO_VERSION = readFile(".go-version").trim()
62+
def regexps =[
63+
"^devtools/mage.*",
64+
"^libbeat/scripts/Makefile",
65+
]
66+
env.BEATS_UPDATED = isGitRegionMatch(patterns: regexps)
67+
// Skip all the stages except docs for PR's with asciidoc changes only
68+
env.ONLY_DOCS = isGitRegionMatch(patterns: [ '.*\\.asciidoc' ], comparator: 'regexp', shouldMatchAll: true)
69+
}
6870
}
6971
}
7072
}
71-
}
72-
/**
73-
updates beats updates the framework part and go parts of beats.
74-
Then build and test.
75-
Finally archive the results.
76-
*/
77-
stage('Update Beats') {
78-
options { skipDefaultCheckout() }
79-
when {
80-
beforeAgent true
81-
anyOf {
82-
branch 'master'
83-
branch "\\d+\\.\\d+"
84-
branch "v\\d?"
85-
tag "v\\d+\\.\\d+\\.\\d+*"
86-
allOf {
87-
expression { return env.BEATS_UPDATED != "false" || isCommentTrigger() }
88-
changeRequest()
89-
}
73+
/**
74+
updates beats updates the framework part and go parts of beats.
75+
Then build and test.
76+
Finally archive the results.
77+
*/
78+
stage('Update Beats') {
79+
options { skipDefaultCheckout() }
80+
when {
81+
beforeAgent true
82+
anyOf {
83+
branch 'master'
84+
branch "\\d+\\.\\d+"
85+
branch "v\\d?"
86+
tag "v\\d+\\.\\d+\\.\\d+*"
87+
allOf {
88+
expression { return env.BEATS_UPDATED != "false" || isCommentTrigger() }
89+
changeRequest()
90+
}
9091

92+
}
9193
}
92-
}
93-
steps {
94-
withGithubNotify(context: 'Check Apm Server Beats Update') {
95-
beatsUpdate()
94+
steps {
95+
withGithubNotify(context: 'Check Apm Server Beats Update') {
96+
beatsUpdate()
97+
}
9698
}
9799
}
98100
}

.ci/jobs/beats-mbp-2.0.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
- job:
3+
name: Beats/beats-mbp-2.0
4+
display-name: 'Beats (2.0)'
5+
description: 'Beats Main Pipeline 2.0'
6+
view: Beats
7+
concurrent: true
8+
project-type: multibranch
9+
prune-dead-branches: true
10+
days-to-keep: 30
11+
script-path: '.ci/Jenkinsfile'
12+
triggers: []
13+
wrappers: []
14+
scm:
15+
- github:
16+
branch-discovery: 'no-pr'
17+
discover-pr-forks-strategy: 'merge-current'
18+
discover-pr-forks-trust: 'permission'
19+
discover-pr-origin: 'merge-current'
20+
head-filter-regex: '(master|7\.[x789]|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
21+
discover-tags: true
22+
disable-pr-notifications: true
23+
notification-context: "beats-ci-2.0"
24+
repo: 'beats'
25+
repo-owner: 'elastic'
26+
credentials-id: github-app-beats-ci
27+
ssh-checkout:
28+
credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba
29+
build-strategies:
30+
- tags:
31+
ignore-tags-older-than: -1
32+
ignore-tags-newer-than: 365
33+
- change-request:
34+
ignore-target-only-changes: true
35+
- named-branches:
36+
- exact-name:
37+
name: 'master'
38+
case-sensitive: true
39+
- regex-name:
40+
regex: '7\.[x789]'
41+
case-sensitive: true
42+
- regex-name:
43+
regex: '8\.\d+'
44+
case-sensitive: true
45+
clean:
46+
after: true
47+
before: true
48+
prune: true
49+
shallow-clone: true
50+
depth: 3
51+
do-not-fetch-tags: true
52+
submodule:
53+
disable: false
54+
recursive: true
55+
parent-credentials: true
56+
timeout: 100
57+
timeout: '15'
58+
use-author: true
59+
wipe-workspace: true

.ci/jobs/beats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- job:
33
name: Beats/beats
4-
display-name: 'Beats (replacement)'
4+
display-name: 'Beats'
55
description: 'Beats Main Pipeline'
66
view: Beats
77
concurrent: true

.ci/packaging.groovy

+14-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pipeline {
2626
triggers {
2727
issueCommentTrigger('(?i)^\\/packag[ing|e]$')
2828
// disable upstream trigger on a PR basis
29-
upstream("Beats/beats-beats-mbp/${ env.JOB_BASE_NAME.startsWith('PR-') ? 'none' : env.JOB_BASE_NAME }")
29+
upstream("Beats/beats/${ env.JOB_BASE_NAME.startsWith('PR-') ? 'none' : env.JOB_BASE_NAME }")
3030
}
3131
parameters {
3232
booleanParam(name: 'macos', defaultValue: false, description: 'Allow macOS stages.')
@@ -188,8 +188,14 @@ def tagAndPush(name){
188188
if("${env.SNAPSHOT}" == "true"){
189189
libbetaVer += "-SNAPSHOT"
190190
}
191+
192+
def tagName = "${libbetaVer}"
193+
if (env.CHANGE_ID?.trim()) {
194+
tagName = "pr-${env.CHANGE_ID}"
195+
}
196+
191197
def oldName = "${DOCKER_REGISTRY}/beats/${name}:${libbetaVer}"
192-
def newName = "${DOCKER_REGISTRY}/observability-ci/${name}:${libbetaVer}"
198+
def newName = "${DOCKER_REGISTRY}/observability-ci/${name}:${tagName}"
193199
def commitName = "${DOCKER_REGISTRY}/observability-ci/${name}:${env.GIT_BASE_COMMIT}"
194200
dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
195201
retry(3){
@@ -222,7 +228,12 @@ def withMacOSEnv(Closure body){
222228
}
223229

224230
def publishPackages(baseDir){
225-
googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/snapshots",
231+
def bucketUri = "gs://${JOB_GCS_BUCKET}/snapshots"
232+
if (env.CHANGE_ID?.trim()) {
233+
bucketUri = "gs://${JOB_GCS_BUCKET}/pull-requests/pr-${env.CHANGE_ID}"
234+
}
235+
236+
googleStorageUpload(bucket: "${bucketUri}",
226237
credentialsId: "${JOB_GCS_CREDENTIALS}",
227238
pathPrefix: "${baseDir}/build/distributions/",
228239
pattern: "${baseDir}/build/distributions/**/*",

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ x-pack/dockerlogbeat/temproot.tar
3030
x-pack/elastic-agent/elastic_agent
3131
x-pack/elastic-agent/fleet.yml
3232
x-pack/elastic-agent/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86_64/configurable
33+
x-pack/elastic-agent/pkg/agent/operation/tests/scripts/serviceable-1.0-darwin-x86_64/serviceable
3334

3435
# Editor swap files
3536
*.swp

0 commit comments

Comments
 (0)