Skip to content

Commit

Permalink
Merge branch 'master' into 29269-auditbeat-script
Browse files Browse the repository at this point in the history
  • Loading branch information
kvch authored Jan 28, 2022
2 parents 9b1ad07 + 8cc07dd commit 7c7f293
Show file tree
Hide file tree
Showing 466 changed files with 12,413 additions and 2,486 deletions.
7 changes: 2 additions & 5 deletions .ci/jobs/apm-beats-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
discover-pr-forks-trust: 'permission'
discover-pr-origin: 'merge-current'
discover-tags: true
head-filter-regex: '(master|7\.[x789]|7\.1\d|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
head-filter-regex: '(master|7\.1[6789]|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
disable-pr-notifications: true
notification-context: 'apm-beats-update'
repo: 'beats'
Expand All @@ -36,10 +36,7 @@
name: 'master'
case-sensitive: true
- regex-name:
regex: '7\.[x789]'
case-sensitive: true
- regex-name:
regex: '7\.1\d'
regex: '7\.1[6789]'
case-sensitive: true
- regex-name:
regex: '8\.\d+'
Expand Down
4 changes: 2 additions & 2 deletions .ci/jobs/beats-tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
discover-pr-forks-trust: 'permission'
discover-pr-origin: 'merge-current'
discover-tags: true
head-filter-regex: '(master|7\.([x9]|1\d+)|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
head-filter-regex: '(master|7\.1[6789]|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
disable-pr-notifications: true
notification-context: 'beats-tester'
repo: 'beats'
Expand All @@ -32,7 +32,7 @@
name: 'master'
case-sensitive: true
- regex-name:
regex: '7\.([x9]|1\d+)'
regex: '7\.1[6789]'
case-sensitive: true
- regex-name:
regex: '8\.\d+'
Expand Down
5 changes: 1 addition & 4 deletions .ci/jobs/beats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
regex: '6\.[89]'
case-sensitive: true
- regex-name:
regex: '7\.[x789]'
case-sensitive: true
- regex-name:
regex: '7\.1\d'
regex: '7\.1[6789]'
case-sensitive: true
- regex-name:
regex: '8\.\d+'
Expand Down
7 changes: 2 additions & 5 deletions .ci/jobs/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
discover-pr-forks-trust: 'permission'
discover-pr-origin: 'merge-current'
discover-tags: true
head-filter-regex: '(master|7\.[x789]|7\.1\d|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
head-filter-regex: '(master|7\.1[6789]|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
disable-pr-notifications: true
notification-context: 'beats-packaging'
repo: 'beats'
Expand All @@ -32,10 +32,7 @@
name: 'master'
case-sensitive: true
- regex-name:
regex: '7\.[x789]'
case-sensitive: true
- regex-name:
regex: '7\.1\d'
regex: '7\.1[6789]'
case-sensitive: true
- regex-name:
regex: '8\.\d+'
Expand Down
3 changes: 1 addition & 2 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ def tagAndPush(Map args = [:]) {
tagName = "pr-${env.CHANGE_ID}"
}

dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")

// supported tags
def tags = [tagName, "${env.GIT_BASE_COMMIT}"]
if (!isPR() && aliasVersion != "") {
Expand Down Expand Up @@ -386,6 +384,7 @@ def release(){
withEnv([
"DEV=true"
]) {
dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
dir("${env.BEATS_FOLDER}") {
sh(label: "Release ${env.BEATS_FOLDER} ${env.PLATFORMS}", script: 'mage package')
}
Expand Down
2 changes: 1 addition & 1 deletion .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function dockerPullCommonImages() {
docker.elastic.co/observability-ci/database-enterprise:12.2.0.1
docker.elastic.co/beats-dev/fpm:1.11.0
golang:1.14.12-stretch
centos:7
ubuntu:20.04
"
for image in ${DOCKER_IMAGES} ; do
(retry 2 docker pull ${image}) || echo "Error pulling ${image} Docker image. Continuing."
Expand Down
44 changes: 34 additions & 10 deletions .ci/schedule-daily.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ pipeline {
stages {
stage('Nighly beats builds') {
steps {
runBuild(quietPeriod: 0, job: 'Beats/beats/master')
// This should be `current_8` bump.getCurrentMinorReleaseFor8
runBuild(quietPeriod: 2000, job: 'Beats/beats/8.0')
// This should be `current_7` bump.getCurrentMinorReleaseFor7 or
// `next_minor_7` bump.getNextMinorReleaseFor7
runBuild(quietPeriod: 4000, job: 'Beats/beats/7.17')
runBuild(quietPeriod: 6000, job: 'Beats/beats/7.16')
runBuilds(quietPeriodFactor: 2000, branches: ['master', '8.<minor>', '7.<minor>', '7.<next-minor>'])
}
}
}
Expand All @@ -37,7 +31,37 @@ pipeline {
}
}

def runBuild(Map args = [:]) {
def jobName = args.job
build(quietPeriod: args.quietPeriod, job: jobName, parameters: [booleanParam(name: 'macosTest', value: true)], wait: false, propagate: false)
def runBuilds(Map args = [:]) {
def branches = []
// Expand macros and filter duplicated matches.
args.branches.each { branch ->
def branchName = getBranchName(branch)
if (!branches.contains(branchName)) {
branches << branchName
}
}

def quietPeriod = 0
branches.each { branch ->
build(quietPeriod: quietPeriod, job: "Beats/beats/${branch}", parameters: [booleanParam(name: 'macosTest', value: true)], wait: false, propagate: false)
// Increate the quiet period for the next iteration
quietPeriod += args.quietPeriodFactor
}
}

def getBranchName(branch) {
// special macro to look for the latest minor version
if (branch.contains('8.<minor>')) {
return bumpUtils.getMajorMinor(bumpUtils.getCurrentMinorReleaseFor8())
}
if (branch.contains('8.<next-minor>')) {
return bumpUtils.getMajorMinor(bumpUtils.getNextMinorReleaseFor8())
}
if (branch.contains('7.<minor>')) {
return bumpUtils.getMajorMinor(bumpUtils.getCurrentMinorReleaseFor7())
}
if (branch.contains('7.<next-minor>')) {
return bumpUtils.getMajorMinor(bumpUtils.getNextMinorReleaseFor7())
}
return branch
}
44 changes: 34 additions & 10 deletions .ci/schedule-weekly.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ pipeline {
stages {
stage('Weekly beats builds') {
steps {
runBuild(quietPeriod: 0, job: 'Beats/beats/master')
// This should be `current_8` bump.getCurrentMinorReleaseFor8
runBuild(quietPeriod: 1000, job: 'Beats/beats/8.0')
// This should be `current_7` bump.getCurrentMinorReleaseFor7 or
// `next_minor_7` bump.getNextMinorReleaseFor7
runBuild(quietPeriod: 2000, job: 'Beats/beats/7.17')
runBuild(quietPeriod: 3000, job: 'Beats/beats/7.16')
runBuilds(quietPeriodFactor: 1000, branches: ['master', '8.<minor>', '7.<minor>', '7.<next-minor>'])
}
}
}
Expand All @@ -37,7 +31,37 @@ pipeline {
}
}

def runBuild(Map args = [:]) {
def jobName = args.job
build(quietPeriod: args.quietPeriod, job: jobName, parameters: [booleanParam(name: 'awsCloudTests', value: true)], wait: false, propagate: false)
def runBuilds(Map args = [:]) {
def branches = []
// Expand macros and filter duplicated matches.
args.branches.each { branch ->
def branchName = getBranchName(branch)
if (!branches.contains(branchName)) {
branches << branchName
}
}

def quietPeriod = 0
branches.each { branch ->
build(quietPeriod: quietPeriod, job: "Beats/beats/${branch}", parameters: [booleanParam(name: 'awsCloudTests', value: true)], wait: false, propagate: false)
// Increate the quiet period for the next iteration
quietPeriod += args.quietPeriodFactor
}
}

def getBranchName(branch) {
// special macro to look for the latest minor version
if (branch.contains('8.<minor>')) {
return bumpUtils.getMajorMinor(bumpUtils.getCurrentMinorReleaseFor8())
}
if (branch.contains('8.<next-minor>')) {
return bumpUtils.getMajorMinor(bumpUtils.getNextMinorReleaseFor8())
}
if (branch.contains('7.<minor>')) {
return bumpUtils.getMajorMinor(bumpUtils.getCurrentMinorReleaseFor7())
}
if (branch.contains('7.<next-minor>')) {
return bumpUtils.getMajorMinor(bumpUtils.getNextMinorReleaseFor7())
}
return branch
}
14 changes: 4 additions & 10 deletions .ci/scripts/install-tools.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,15 @@ SET PREVIOUS_USERPROFILE=%USERPROFILE%
SET USERPROFILE=%OLD_USERPROFILE%
IF NOT EXIST C:\Python38\python.exe (
REM Install python 3.8
choco install python -y -r --no-progress --version 3.8.5
IF NOT ERRORLEVEL 0 (
exit /b 1
)
choco install python -y -r --no-progress --version 3.8.5 || exit /b 1
)
python --version
where python

where /q gcc
IF ERRORLEVEL 1 (
WHERE /q gcc
IF %ERRORLEVEL% NEQ 0 (
REM Install mingw 5.3.0
choco install mingw -y -r --no-progress --version 5.3.0
IF NOT ERRORLEVEL 0 (
exit /b 1
)
choco install mingw -y -r --no-progress --version 5.3.0 || exit /b 1
)
gcc --version
where gcc
Expand Down
9 changes: 5 additions & 4 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ daysUntilClose: 30
onlyLabels: []

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels: []
exemptLabels:
- flaky-test

# Set to true to ignore issues in a project (defaults to false)
exemptProjects: true
exemptProjects: false

# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
Expand Down Expand Up @@ -47,7 +48,7 @@ limitPerRun: 30

# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
pulls:
daysUntilStale: 30
daysUntilStale: 90
daysUntilClose: 30
markComment: >
Hi!
Expand Down Expand Up @@ -79,4 +80,4 @@ pulls:
# issues:
# exemptLabels:
# - confirmed
# - confirmed
31 changes: 31 additions & 0 deletions .github/workflows/macos-auditbeat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: auditbeat

on:
pull_request:
paths:
- '.github/workflows/macos-auditbeat.yml'
push:
branches:
- master
- 7.1*
- 8.*

env:
BEAT_MODULE: 'auditbeat'

jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Fetch Go version from .go-version
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Install dependencies
run: go get -u github.com/magefile/mage
- name: Run build
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
31 changes: 31 additions & 0 deletions .github/workflows/macos-filebeat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: filebeat

on:
pull_request:
paths:
- '.github/workflows/macos-filebeat.yml'
push:
branches:
- master
- 7.1*
- 8.*

env:
BEAT_MODULE: 'filebeat'

jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Fetch Go version from .go-version
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Install dependencies
run: go get -u github.com/magefile/mage
- name: Run build
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
31 changes: 31 additions & 0 deletions .github/workflows/macos-heartbeat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: heartbeat

on:
pull_request:
paths:
- '.github/workflows/macos-heartbeat.yml'
push:
branches:
- master
- 7.1*
- 8.*

env:
BEAT_MODULE: 'heartbeat'

jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Fetch Go version from .go-version
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Install dependencies
run: go get -u github.com/magefile/mage
- name: Run build
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && mage unitTest
31 changes: 31 additions & 0 deletions .github/workflows/macos-metricbeat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: metricbeat

on:
pull_request:
paths:
- '.github/workflows/macos-metricbeat.yml'
push:
branches:
- master
- 7.1*
- 8.*

env:
BEAT_MODULE: 'metricbeat'

jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Fetch Go version from .go-version
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Install dependencies
run: go get -u github.com/magefile/mage
- name: Run build
run: cd ${{ env.BEAT_MODULE }} && mage build
- name: Run test
run: cd ${{ env.BEAT_MODULE }} && echo "See https://github.com/elastic/beats/issues/29038"
Loading

0 comments on commit 7c7f293

Please sign in to comment.