forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature-stack-monitoring-mb-ecs
- Loading branch information
Showing
2,148 changed files
with
491,735 additions
and
64,087 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env groovy | ||
|
||
@Library('apm@current') _ | ||
|
||
pipeline { | ||
agent none | ||
environment { | ||
BASE_DIR = 'src/github.com/elastic/beats' | ||
PIPELINE_LOG_LEVEL = "INFO" | ||
BEATS_TESTER_JOB = 'Beats/beats-tester-mbp/master' | ||
BASE_URL = "https://staging.elastic.co/${params.version}/downloads" | ||
APM_BASE_URL = "${env.BASE_URL}/apm-server" | ||
BEATS_BASE_URL = "${env.BASE_URL}/beats" | ||
VERSION = "${params.version?.split('-')[0]}" | ||
} | ||
options { | ||
timeout(time: 2, unit: 'HOURS') | ||
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30')) | ||
timestamps() | ||
ansiColor('xterm') | ||
disableResume() | ||
durabilityHint('PERFORMANCE_OPTIMIZED') | ||
disableConcurrentBuilds() | ||
} | ||
parameters { | ||
string(name: 'version', defaultValue: '', description: 'Id of the Build Candidate (7.10.0-b55684ff).') | ||
string(name: 'BRANCH_REFERENCE', defaultValue: 'master', description: 'Branch to grab the Groovy script(for test changes).') | ||
} | ||
stages { | ||
stage('Run Beat Tester') { | ||
options { skipDefaultCheckout() } | ||
when { | ||
expression { | ||
return '' != "${VERSION}" | ||
} | ||
} | ||
steps { | ||
build(job: env.BEATS_TESTER_JOB, propagate: true, wait: true, | ||
parameters: [ | ||
string(name: 'APM_URL_BASE', value: "${APM_BASE_URL}"), | ||
string(name: 'BEATS_URL_BASE', value: "${BEATS_BASE_URL}"), | ||
string(name: 'VERSION', value: "${VERSION}") | ||
]) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
#!/usr/bin/env groovy | ||
|
||
@Library('apm@current') _ | ||
|
||
pipeline { | ||
agent none | ||
environment { | ||
BASE_DIR = 'src/github.com/elastic/beats' | ||
PIPELINE_LOG_LEVEL = "INFO" | ||
BEATS_TESTER_JOB = 'Beats/beats-tester-mbp/master' | ||
} | ||
options { | ||
timeout(time: 1, unit: 'HOURS') | ||
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20', daysToKeepStr: '30')) | ||
timestamps() | ||
ansiColor('xterm') | ||
disableResume() | ||
durabilityHint('PERFORMANCE_OPTIMIZED') | ||
disableConcurrentBuilds() | ||
} | ||
triggers { | ||
issueCommentTrigger('(?i)^\\/beats-tester$') | ||
upstream("Beats/packaging/${env.JOB_BASE_NAME}") | ||
} | ||
stages { | ||
stage('Filter build') { | ||
agent { label 'ubuntu && immutable' } | ||
when { | ||
beforeAgent true | ||
anyOf { | ||
triggeredBy cause: "IssueCommentCause" | ||
expression { | ||
def ret = isUserTrigger() || isUpstreamTrigger() | ||
if(!ret){ | ||
currentBuild.result = 'NOT_BUILT' | ||
currentBuild.description = "The build has been skipped" | ||
currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" | ||
echo("the build has been skipped due the trigger is a branch scan and the allow ones are manual, GitHub comment, and upstream job") | ||
} | ||
return ret | ||
} | ||
} | ||
} | ||
stages { | ||
stage('Checkout') { | ||
options { skipDefaultCheckout() } | ||
steps { | ||
deleteDir() | ||
gitCheckout(basedir: "${BASE_DIR}") | ||
setEnvVar('VERSION', sh(script: "grep ':stack-version:' ${BASE_DIR}/libbeat/docs/version.asciidoc | cut -d' ' -f2", returnStdout: true).trim()) | ||
} | ||
} | ||
stage('Build master') { | ||
options { skipDefaultCheckout() } | ||
when { branch 'master' } | ||
steps { | ||
runBeatsTesterJob(version: "${env.VERSION}-SNAPSHOT") | ||
} | ||
} | ||
stage('Build *.x branch') { | ||
options { skipDefaultCheckout() } | ||
when { branch '*.x' } | ||
steps { | ||
runBeatsTesterJob(version: "${env.VERSION}-SNAPSHOT") | ||
} | ||
} | ||
stage('Build PullRequest') { | ||
options { skipDefaultCheckout() } | ||
when { changeRequest() } | ||
steps { | ||
runBeatsTesterJob(version: "${env.VERSION}-SNAPSHOT", | ||
apm: "https://storage.googleapis.com/apm-ci-artifacts/jobs/pull-requests/pr-${env.CHANGE_ID}", | ||
beats: "https://storage.googleapis.com/beats-ci-artifacts/pull-requests/pr-${env.CHANGE_ID}") | ||
} | ||
} | ||
stage('Build release branch') { | ||
options { skipDefaultCheckout() } | ||
when { | ||
not { | ||
anyOf { | ||
branch comparator: 'REGEXP', pattern: '(master|.*x)' | ||
changeRequest() | ||
} | ||
} | ||
} | ||
steps { | ||
// TODO: to use the git commit that triggered the upstream build | ||
runBeatsTesterJob(version: "${env.VERSION}-SNAPSHOT") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
def runBeatsTesterJob(Map args = [:]) { | ||
def apm = args.get('apm', '') | ||
def beats = args.get('beats', '') | ||
def version = args.version | ||
|
||
if (isUpstreamTrigger()) { | ||
copyArtifacts(filter: 'beats-tester.properties', | ||
flatten: true, | ||
projectName: "Beats/packaging/${env.JOB_BASE_NAME}", | ||
selector: upstream(fallbackToLastSuccessful: true)) | ||
def props = readProperties(file: 'beats-tester.properties') | ||
apm = props.get('APM_URL_BASE', '') | ||
beats = props.get('BEATS_URL_BASE', '') | ||
version = props.get('VERSION', '8.0.0-SNAPSHOT') | ||
} | ||
if (apm?.trim() || beats?.trim()) { | ||
build(job: env.BEATS_TESTER_JOB, propagate: false, wait: false, | ||
parameters: [ | ||
string(name: 'APM_URL_BASE', value: apm), | ||
string(name: 'BEATS_URL_BASE', value: beats), | ||
string(name: 'VERSION', value: version) | ||
]) | ||
} else { | ||
build(job: env.BEATS_TESTER_JOB, propagate: false, wait: false, parameters: [ string(name: 'VERSION', value: version) ]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
- job: | ||
name: Beats/beats-tester-bc | ||
display-name: Beats Tester orchestrator for Build Candidates | ||
description: Launch the beat-tester suit on Build Candidates easily | ||
view: Beats | ||
disabled: false | ||
project-type: pipeline | ||
parameters: | ||
- string: | ||
name: BRANCH_REFERENCE | ||
default: master | ||
description: the Git branch specifier | ||
pipeline-scm: | ||
script-path: .ci/beats-tester-bc.groovy | ||
scm: | ||
- git: | ||
url: git@github.com:elastic/beats.git | ||
refspec: +refs/heads/*:refs/remotes/origin/* | ||
wipe-workspace: true | ||
name: origin | ||
shallow-clone: true | ||
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba | ||
reference-repo: /var/lib/jenkins/.git-references/beats.git | ||
branches: | ||
- $BRANCH_REFERENCE |
Oops, something went wrong.