Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/windows-10
Browse files Browse the repository at this point in the history
* upstream/master: (127 commits)
  Update obs app links (elastic#21682)
  fix: update fleet test suite name (elastic#21738)
  Remove dot from file.extension value in Auditbeat FIM (elastic#21644)
  Fix leaks with metadata processors (elastic#16349)
  Add istiod metricset (elastic#21519)
  [Ingest Manager] Change Sync/Close call order (elastic#21735)
  [Ingest Manager] Syncing unpacked files (elastic#21706)
  Fix concurrent map read and write in socket dataset (elastic#21690)
  Fix conditional coding to remove seccomp info from Winlogbeat (elastic#21652)
  [Elastic Agent] Fix issue where inputs without processors defined would panic (elastic#21628)
  Add configuration of filestream input (elastic#21565)
  libbeat/logp: introduce Logger.WithOptions (elastic#21671)
  Make o365audit input cancellable (elastic#21647)
  fix: remove extra curly brace in script (elastic#21692)
  [Winlogbeat] Remove brittle configuration validation from wineventlog (elastic#21593)
  Fix function that parses from/to/contact headers (elastic#21672)
  [CI] Support Windows-2016 in pipeline 2.0 (elastic#21337)
  Skip publisher flaky tests (elastic#21657)
  backport: add 7.10 branch (elastic#21635)
  [CI: Packaging] fix: push ubi8 images too (elastic#21621)
  ...
  • Loading branch information
v1v committed Oct 13, 2020
2 parents 65f905c + 1824e84 commit aa4bf15
Show file tree
Hide file tree
Showing 778 changed files with 52,938 additions and 20,432 deletions.
2 changes: 1 addition & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"upstream": "elastic/beats",
"branches": [{ "name": "7.9"}, { "name": "7.8"}, { "name": "7.7"}, { "name": "7.x"}],
"branches": [ { "name": "7.x", "checked": true }, "7.10", "7.9", "7.8", "7.7"],
"labels": ["backport"],
"autoAssign": true,
"prTitle": "Cherry-pick to {targetBranch}: {commitMessages}"
Expand Down
7 changes: 5 additions & 2 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]|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
head-filter-regex: '(master|7\.[x789]|7\.1\d|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
disable-pr-notifications: true
notification-context: 'apm-beats-update'
repo: 'beats'
Expand All @@ -38,6 +38,9 @@
- regex-name:
regex: '7\.[x789]'
case-sensitive: true
- regex-name:
regex: '7\.1\d'
case-sensitive: true
- regex-name:
regex: '8\.\d+'
case-sensitive: true
Expand All @@ -48,7 +51,7 @@
before: true
prune: true
shallow-clone: true
depth: 3
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
20 changes: 20 additions & 0 deletions .ci/jobs/beats-release-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- job:
name: Beats/Release/beats-release-changelog
display-name: 'Prepare the Changelog for a Release'
description: 'Automate the steps to prepare the Changelog for a Release'
view: Beats
project-type: pipeline
pipeline-scm:
script-path: release_scripts/pipeline-release-changelog.groovy
scm:
- git:
url: git@github.com:elastic/ingest-dev.git
refspec: +refs/heads/*:refs/remotes/origin/* +refs/pull/*/head:refs/remotes/origin/pr/*
wipe-workspace: 'True'
name: origin
shallow-clone: true
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
reference-repo: /var/lib/jenkins/.git-references/ingest-dev.git
branches:
- master
20 changes: 20 additions & 0 deletions .ci/jobs/beats-release-minor-major.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- job:
name: Beats/Release/beats-release-minor-major
display-name: 'Prepare Major/minor Release'
description: 'Automate the steps to prepare a new Release branch'
view: Beats
project-type: pipeline
pipeline-scm:
script-path: release_scripts/pipeline-release-minor-major.groovy
scm:
- git:
url: git@github.com:elastic/ingest-dev.git
refspec: +refs/heads/*:refs/remotes/origin/* +refs/pull/*/head:refs/remotes/origin/pr/*
wipe-workspace: 'True'
name: origin
shallow-clone: true
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
reference-repo: /var/lib/jenkins/.git-references/ingest-dev.git
branches:
- master
20 changes: 20 additions & 0 deletions .ci/jobs/beats-release-patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- job:
name: Beats/Release/beats-release-patch
display-name: 'Prepare Patch Release'
description: 'Automate the steps to prepare a new Patch'
view: Beats
project-type: pipeline
pipeline-scm:
script-path: release_scripts/pipeline-release-patch.groovy
scm:
- git:
url: git@github.com:elastic/ingest-dev.git
refspec: +refs/heads/*:refs/remotes/origin/* +refs/pull/*/head:refs/remotes/origin/pr/*
wipe-workspace: 'True'
name: origin
shallow-clone: true
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
reference-repo: /var/lib/jenkins/.git-references/ingest-dev.git
branches:
- master
2 changes: 1 addition & 1 deletion .ci/jobs/beats-tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
before: true
prune: true
shallow-clone: true
depth: 3
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
56 changes: 0 additions & 56 deletions .ci/jobs/beats-windows-mbp.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .ci/jobs/beats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
discover-pr-forks-strategy: 'merge-current'
discover-pr-forks-trust: 'permission'
discover-pr-origin: 'merge-current'
head-filter-regex: '(master|7\.[x789]|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
head-filter-regex: '(master|7\.[x789]|7\.1\d|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
discover-tags: true
notification-context: "beats-ci"
repo: 'beats'
Expand All @@ -38,6 +38,9 @@
- regex-name:
regex: '7\.[x789]'
case-sensitive: true
- regex-name:
regex: '7\.1\d'
case-sensitive: true
- regex-name:
regex: '8\.\d+'
case-sensitive: true
Expand All @@ -46,13 +49,14 @@
before: true
prune: true
shallow-clone: true
depth: 3
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
recursive: true
parent-credentials: true
timeout: 100
reference-repo: /var/lib/jenkins/.git-references/beats.git
timeout: '15'
use-author: true
wipe-workspace: true
5 changes: 5 additions & 0 deletions .ci/jobs/folders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
name: Beats
description: Beats
project-type: folder

- job:
name: Beats/Release
description: Jobs for release preparation
project-type: folder
2 changes: 1 addition & 1 deletion .ci/jobs/golang-crossbuild-mbp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
before: true
prune: true
shallow-clone: true
depth: 4
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
7 changes: 5 additions & 2 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]|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
head-filter-regex: '(master|7\.[x789]|7\.1\d|8\.\d+|PR-.*|v\d+\.\d+\.\d+)'
disable-pr-notifications: true
notification-context: 'beats-packaging'
repo: 'beats'
Expand All @@ -34,6 +34,9 @@
- regex-name:
regex: '7\.[x789]'
case-sensitive: true
- regex-name:
regex: '7\.1\d'
case-sensitive: true
- regex-name:
regex: '8\.\d+'
case-sensitive: true
Expand All @@ -44,7 +47,7 @@
before: true
prune: true
shallow-clone: true
depth: 3
depth: 10
do-not-fetch-tags: true
submodule:
disable: false
Expand Down
89 changes: 78 additions & 11 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
pipeline {
agent none
environment {
BASE_DIR = 'src/github.com/elastic/beats'
REPO = 'beats'
BASE_DIR = "src/github.com/elastic/${env.REPO}"
JOB_GCS_BUCKET = 'beats-ci-artifacts'
JOB_GCS_BUCKET_STASH = 'beats-ci-temp'
JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin'
DOCKERELASTIC_SECRET = 'secret/observability-team/ci/docker-registry/prod'
DOCKER_REGISTRY = 'docker.elastic.co'
GITHUB_CHECK_E2E_TESTS_NAME = 'E2E Tests'
SNAPSHOT = "true"
PIPELINE_LOG_LEVEL = "INFO"
}
Expand Down Expand Up @@ -119,6 +121,7 @@ pipeline {
release()
pushCIDockerImages()
}
runE2ETestForPackages()
}
}
stage('Package Mac OS'){
Expand Down Expand Up @@ -195,17 +198,49 @@ def tagAndPush(name){
tagName = "pr-${env.CHANGE_ID}"
}

def oldName = "${DOCKER_REGISTRY}/beats/${name}:${libbetaVer}"
def newName = "${DOCKER_REGISTRY}/observability-ci/${name}:${tagName}"
def commitName = "${DOCKER_REGISTRY}/observability-ci/${name}:${env.GIT_BASE_COMMIT}"
dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
retry(3){
sh(label:'Change tag and push', script: """
docker tag ${oldName} ${newName}
docker push ${newName}
docker tag ${oldName} ${commitName}
docker push ${commitName}
""")

// supported image flavours
def variants = ["", "-oss", "-ubi8"]
variants.each { variant ->
def oldName = "${DOCKER_REGISTRY}/beats/${name}${variant}:${libbetaVer}"
def newName = "${DOCKER_REGISTRY}/observability-ci/${name}${variant}:${tagName}"
def commitName = "${DOCKER_REGISTRY}/observability-ci/${name}${variant}:${env.GIT_BASE_COMMIT}"

def iterations = 0
retryWithSleep(retries: 3, seconds: 5, backoff: true)
iterations++
def status = sh(label:'Change tag and push', script: """
docker tag ${oldName} ${newName}
docker push ${newName}
docker tag ${oldName} ${commitName}
docker push ${commitName}
""", returnStatus: true)

if ( status > 0 && iterations < 3) {
error('tag and push failed, retry')
} else if ( status > 0 ) {
log(level: 'WARN', text: "${name} doesn't have ${variant} docker images. See https://github.com/elastic/beats/pull/21621")
}
}
}

def runE2ETestForPackages(){
def suite = ''

catchError(buildResult: 'UNSTABLE', message: 'Unable to run e2e tests', stageResult: 'FAILURE') {
if ("${env.BEATS_FOLDER}" == "filebeat" || "${env.BEATS_FOLDER}" == "x-pack/filebeat") {
suite = 'helm,fleet'
} else if ("${env.BEATS_FOLDER}" == "metricbeat" || "${env.BEATS_FOLDER}" == "x-pack/metricbeat") {
suite = ''
} else if ("${env.BEATS_FOLDER}" == "x-pack/elastic-agent") {
suite = 'fleet'
} else {
echo("Skipping E2E tests for ${env.BEATS_FOLDER}.")
return
}

triggerE2ETests(suite)
}
}

Expand All @@ -218,6 +253,38 @@ def release(){
}
}

def triggerE2ETests(String suite) {
echo("Triggering E2E tests for ${env.BEATS_FOLDER}. Test suite: ${suite}.")

def branchName = isPR() ? "${env.CHANGE_TARGET}" : "${env.JOB_BASE_NAME}"
def e2eTestsPipeline = "e2e-tests/e2e-testing-mbp/${branchName}"

def parameters = [
booleanParam(name: 'forceSkipGitChecks', value: true),
booleanParam(name: 'forceSkipPresubmit', value: true),
booleanParam(name: 'notifyOnGreenBuilds', value: !isPR()),
string(name: 'runTestsSuites', value: suite),
string(name: 'GITHUB_CHECK_NAME', value: env.GITHUB_CHECK_E2E_TESTS_NAME),
string(name: 'GITHUB_CHECK_REPO', value: env.REPO),
string(name: 'GITHUB_CHECK_SHA1', value: env.GIT_BASE_COMMIT),
]
if (isPR()) {
def version = "pr-${env.CHANGE_ID}"
parameters.push(booleanParam(name: 'USE_CI_SNAPSHOTS', value: true))
parameters.push(string(name: 'ELASTIC_AGENT_VERSION', value: "${version}"))
parameters.push(string(name: 'METRICBEAT_VERSION', value: "${version}"))
}

build(job: "${e2eTestsPipeline}",
parameters: parameters,
propagate: false,
wait: false
)

def notifyContext = "${env.GITHUB_CHECK_E2E_TESTS_NAME} for ${env.BEATS_FOLDER}"
githubNotify(context: "${notifyContext}", description: "${notifyContext} ...", status: 'PENDING', targetUrl: "${env.JENKINS_URL}search/?q=${e2eTestsPipeline.replaceAll('/','+')}")
}

def withMacOSEnv(Closure body){
withEnvMask( vars: [
[var: "KEYCHAIN_PASS", password: getVaultSecret(secret: "secret/jenkins-ci/macos-codesign-keychain").data.password],
Expand Down
Loading

0 comments on commit aa4bf15

Please sign in to comment.