-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: workflow on PR, merges and nightlies (#23)
- Loading branch information
Showing
3 changed files
with
143 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
- job: | ||
name: "elastic-agent/elastic-agent-schedule-daily" | ||
display-name: Jobs scheduled daily (weekdays) | ||
description: Jobs scheduled daily (weekdays) | ||
view: Beats | ||
project-type: pipeline | ||
parameters: | ||
- string: | ||
name: branch_specifier | ||
default: main | ||
description: the Git branch specifier to build | ||
pipeline-scm: | ||
script-path: .ci/schedule-daily.groovy | ||
scm: | ||
- git: | ||
url: [email protected]:elastic/elastic-agent-poc.git | ||
refspec: +refs/heads/*:refs/remotes/origin/* | ||
wipe-workspace: 'True' | ||
name: origin | ||
shallow-clone: true | ||
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba | ||
branches: | ||
- $branch_specifier | ||
triggers: | ||
- timed: 'H H(2-3) * * 1-5' |
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,73 @@ | ||
@Library('apm@current') _ | ||
|
||
pipeline { | ||
agent none | ||
environment { | ||
NOTIFY_TO = credentials('notify-to') | ||
PIPELINE_LOG_LEVEL = 'INFO' | ||
} | ||
options { | ||
timeout(time: 1, unit: 'HOURS') | ||
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20')) | ||
timestamps() | ||
ansiColor('xterm') | ||
disableResume() | ||
durabilityHint('PERFORMANCE_OPTIMIZED') | ||
} | ||
triggers { | ||
cron('H H(2-3) * * 1-5') | ||
} | ||
stages { | ||
stage('Nighly beats builds') { | ||
steps { | ||
runBuilds(quietPeriodFactor: 2000, branches: ['main', '8.<minor>', '7.<minor>', '7.<next-minor>']) | ||
} | ||
} | ||
} | ||
post { | ||
cleanup { | ||
notifyBuildResult(prComment: 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: "elastic-agent/elastic-agent-poc-mbp/${branch}", | ||
parameters: [ | ||
booleanParam(name: 'integration_tests_ci', value: true), | ||
booleanParam(name: 'end_to_end_tests_ci', 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 | ||
} |