Skip to content

Commit

Permalink
chore: move schedule from kibana-artifacts-trigger to a trigger sched…
Browse files Browse the repository at this point in the history
…ule on trigger-version-dependent-jobs
  • Loading branch information
delanni committed Jul 1, 2024
1 parent 4cb0c47 commit 5066bb2
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ spec:
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts'
allow_rebuilds: true
branch_configuration: '8.14'
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/artifacts_trigger.yml
Expand All @@ -45,8 +44,3 @@ spec:
access_level: MANAGE_BUILD_AND_READ
kibana-tech-leads:
access_level: MANAGE_BUILD_AND_READ
schedules:
Daily build (8.14):
cronline: 0 */2 * * * America/New_York
message: Daily build
branch: '8.14'
1 change: 1 addition & 0 deletions .buildkite/pipeline-resource-definitions/locations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ spec:
- https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-gen-ai.yml
- https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-investigations.yml
- https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-rule-management.yml
- https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,9 @@ spec:
env:
TRIGGER_PIPELINE_SET: artifacts-snapshot
MESSAGE: Daily snapshot build
Run kibana-artifacts-trigger:
cronline: 0 */2 * * * America/New_York
message: Trigger 'kibana-artifacts-trigger'
env:
TRIGGER_PIPELINE_SET: artifacts-trigger
MESSAGE: Daily build
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const pipelineSets = {
'es-forward': 'kibana-es-forward',
'artifacts-snapshot': 'kibana-artifacts-snapshot',
'artifacts-staging': 'kibana-artifacts-staging',
'artifacts-trigger': 'kibana-artifacts-trigger',
};

/**
Expand Down Expand Up @@ -52,6 +53,9 @@ async function main() {
pipelineSteps.push(...getArtifactStagingPipelineTriggers());
break;
}
case 'artifacts-trigger': {
pipelineSteps.push(...getArtifactBuildTriggers());
}
default: {
throw new Error(`Unknown pipeline set: ${pipelineSetName}`);
}
Expand Down Expand Up @@ -132,6 +136,33 @@ function getArtifactStagingPipelineTriggers() {
});
}

/**
* This pipeline checks if there are any changes in the incorporated $BEATS_MANIFEST_LATEST_URL (beats version)
* and triggers a staging artifact build.
* Should be triggered only for the active minor versions that are not `main` and not `7.17`.
*
* TODO: we could basically do the check logic of .buildkite/scripts/steps/artifacts/trigger.sh in here, and remove kibana-artifacts-trigger
*/
function getArtifactBuildTriggers() {
const branches = getVersionsFile()
.filter((v) => v.branch !== 'main' && v.branch !== '7.17')
.map((v) => v.branch);

return branches.map(
(branch) =>
({
trigger: 'kibana-artifacts-trigger',
async: true,
label: `Triggering artifact build for ${branch}`,
build: {
message: process.env.MESSAGE || `Artifact build for ${branch}`,
branch,
commit: 'HEAD',
},
} as BuildkiteTriggerStep)
);
}

function getVersionsFile(): Array<{
version: string;
branch: string;
Expand Down

0 comments on commit 5066bb2

Please sign in to comment.