Skip to content

Commit e657ea9

Browse files
committed
Merge branch 'backport_23763_7.x' of https://github.com/P1llus/beats into backport_23763_7.x
2 parents 417a7bc + be3fdb4 commit e657ea9

191 files changed

Lines changed: 12202 additions & 2541 deletions

File tree

Some content is hidden

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

.ci/packaging.groovy

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pipeline {
4040
parameters {
4141
booleanParam(name: 'macos', defaultValue: false, description: 'Allow macOS stages.')
4242
booleanParam(name: 'linux', defaultValue: true, description: 'Allow linux stages.')
43+
booleanParam(name: 'arm', defaultValue: true, description: 'Allow ARM stages.')
4344
}
4445
stages {
4546
stage('Filter build') {
@@ -83,12 +84,13 @@ pipeline {
8384
}
8485
}
8586
setEnvVar("GO_VERSION", readFile("${BASE_DIR}/.go-version").trim())
87+
// Stash without any build/dependencies context to support different architectures.
88+
stashV2(name: 'source', bucket: "${JOB_GCS_BUCKET_STASH}", credentialsId: "${JOB_GCS_CREDENTIALS}")
8689
withMageEnv(){
8790
dir("${BASE_DIR}"){
8891
setEnvVar('BEAT_VERSION', sh(label: 'Get beat version', script: 'make get-version', returnStdout: true)?.trim())
8992
}
9093
}
91-
stashV2(name: 'source', bucket: "${JOB_GCS_BUCKET_STASH}", credentialsId: "${JOB_GCS_CREDENTIALS}")
9294
}
9395
}
9496
stage('Build Packages'){
@@ -172,12 +174,73 @@ pipeline {
172174
}
173175
steps {
174176
withGithubNotify(context: "Packaging MacOS ${BEATS_FOLDER}") {
175-
deleteDir()
177+
deleteWorkspace()
176178
withMacOSEnv(){
177179
release()
178180
}
179181
}
180182
}
183+
post {
184+
always {
185+
// static workers require this
186+
deleteWorkspace()
187+
}
188+
}
189+
}
190+
}
191+
}
192+
}
193+
stage('Build Packages ARM'){
194+
matrix {
195+
axes {
196+
axis {
197+
name 'BEATS_FOLDER'
198+
values (
199+
'auditbeat',
200+
'filebeat',
201+
'heartbeat',
202+
'journalbeat',
203+
'metricbeat',
204+
'packetbeat',
205+
'x-pack/auditbeat',
206+
'x-pack/elastic-agent',
207+
'x-pack/filebeat',
208+
'x-pack/heartbeat',
209+
'x-pack/metricbeat',
210+
'x-pack/packetbeat'
211+
)
212+
}
213+
}
214+
stages {
215+
stage('Package Docker images for linux/arm64'){
216+
agent { label 'arm' }
217+
options { skipDefaultCheckout() }
218+
when {
219+
beforeAgent true
220+
expression {
221+
return params.arm
222+
}
223+
}
224+
environment {
225+
HOME = "${env.WORKSPACE}"
226+
PACKAGES = "docker"
227+
PLATFORMS = [
228+
'linux/arm64',
229+
].join(' ')
230+
}
231+
steps {
232+
withGithubNotify(context: "Packaging linux/arm64 ${BEATS_FOLDER}") {
233+
deleteWorkspace()
234+
release()
235+
pushCIDockerImages()
236+
}
237+
}
238+
post {
239+
always {
240+
// static workers require this
241+
deleteWorkspace()
242+
}
243+
}
181244
}
182245
}
183246
}
@@ -408,14 +471,43 @@ def getBeatsName(baseDir) {
408471
}
409472

410473
def withBeatsEnv(Closure body) {
474+
unstashV2(name: 'source', bucket: "${JOB_GCS_BUCKET_STASH}", credentialsId: "${JOB_GCS_CREDENTIALS}")
475+
fixPermissions()
411476
withMageEnv(){
412477
withEnv([
413478
"PYTHON_ENV=${WORKSPACE}/python-env"
414479
]) {
415-
unstashV2(name: 'source', bucket: "${JOB_GCS_BUCKET_STASH}", credentialsId: "${JOB_GCS_CREDENTIALS}")
416480
dir("${env.BASE_DIR}"){
417481
body()
418482
}
419483
}
420484
}
421485
}
486+
487+
/**
488+
* This method fixes the filesystem permissions after the build has happenend. The reason is to
489+
* ensure any non-ephemeral workers don't have any leftovers that could cause some environmental
490+
* issues.
491+
*/
492+
def deleteWorkspace() {
493+
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
494+
fixPermissions()
495+
deleteDir()
496+
}
497+
}
498+
499+
def fixPermissions() {
500+
if(isUnix()) {
501+
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
502+
dir("${env.BASE_DIR}") {
503+
if (fileExists('script/fix_permissions.sh')) {
504+
sh(label: 'Fix permissions', script: """#!/usr/bin/env bash
505+
set +x
506+
source ./dev-tools/common.bash
507+
docker_setup
508+
script/fix_permissions.sh ${WORKSPACE}""", returnStatus: true)
509+
}
510+
}
511+
}
512+
}
513+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ coverage.out
2323
.python-version
2424
beat.db
2525
*.keystore
26+
go_env.properties
2627
mage_output_file.go
2728
x-pack/functionbeat/*/fields.yml
2829
x-pack/functionbeat/provider/*/functionbeat-*

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.15.7
1+
1.15.8

CHANGELOG-developer.next.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,4 @@ The list below covers the major changes between 7.0.0-rc2 and master only.
100100
- Add support for customized monitoring API. {pull}22605[22605]
101101

102102
- Update Go version to 1.15.7. {pull}22495[22495]
103+
- Update Go version to 1.15.8. {pull}23955[23955]

0 commit comments

Comments
 (0)