Skip to content

Commit

Permalink
chore(CI): replace version-dependent pipelines' schedules with schedu…
Browse files Browse the repository at this point in the history
…led trigger through the new pipeline
  • Loading branch information
delanni committed May 22, 2024
1 parent 07ac9cd commit 6442a19
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ spec:
env:
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
allow_rebuilds: true
branch_configuration: main 8.14 7.17
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/artifacts.yml
Expand All @@ -43,16 +42,3 @@ spec:
access_level: MANAGE_BUILD_AND_READ
kibana-tech-leads:
access_level: MANAGE_BUILD_AND_READ
schedules:
Daily build (main):
cronline: 0 7 * * * America/New_York
message: Daily build
branch: main
Daily build (8.14):
cronline: 0 7 * * * America/New_York
message: Daily build
branch: '8.14'
Daily build (7.17):
cronline: 0 7 * * * America/New_York
message: Daily build
branch: '7.17'
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ spec:
RELEASE_BUILD: 'true'
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
allow_rebuilds: true
branch_configuration: 7.17 8.14
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/artifacts.yml
skip_intermediate_builds: false
Expand All @@ -43,12 +42,3 @@ spec:
access_level: MANAGE_BUILD_AND_READ
kibana-tech-leads:
access_level: MANAGE_BUILD_AND_READ
schedules:
Daily build (8.14):
cronline: 0 7 * * * America/New_York
message: Daily build
branch: '8.14'
Daily build (7.17):
cronline: 0 7 * * * America/New_York
message: Daily build
branch: '7.17'
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ spec:
schedules:
Trigger ES forward compatibility tests:
cronline: 0 5 * * *
message: Daily 6 am UTC
branch: main
message: Trigger ES forward compatibility tests
env:
TRIGGER_PIPELINE_SET: es-forward
Trigger artifact staging builds:
cronline: 0 7 * * * America/New_York
message: Trigger artifact staging builds
env:
TRIGGER_PIPELINE_SET: artifacts-staging
Trigger artifact snapshot builds:
cronline: 0 7 * * * America/New_York
message: Trigger artifact snapshot builds
env:
TRIGGER_PIPELINE_SET: artifacts-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function emitPipeline(pipelineSteps: BuildkiteTriggerStep[]) {

const pipelineSets = {
'es-forward': 'kibana-es-forward',
'artifacts-snapshot': 'kibana-artifacts-snapshot',
'artifacts-staging': 'kibana-artifacts-staging',
};

/**
Expand All @@ -38,6 +40,14 @@ async function main() {
pipelineSteps.push(...getESForwardPipelineTriggers());
break;
}
case 'artifacts-snapshot': {
pipelineSteps.push(...getArtifactSnapshotPipelineTriggers());
break;
}
case 'artifacts-staging': {
pipelineSteps.push(...getArtifactStagingPipelineTriggers());
break;
}
default: {
throw new Error(`Unknown pipeline set: ${pipelineSetName}`);
}
Expand Down Expand Up @@ -72,6 +82,44 @@ function getESForwardPipelineTriggers(): BuildkiteTriggerStep[] {
});
}

function getArtifactSnapshotPipelineTriggers() {
// Trigger for all named branches
const versions = getVersionsFile();
const branches = versions.map((v) => v.branch);

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

function getArtifactStagingPipelineTriggers() {
// Trigger for all branches, that are not current minor+major
const versions = getVersionsFile();
const branches = versions.filter((v) => !v.currentMajor && !v.currentMinor).map((v) => v.branch);

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

function isValidPipelineSet(
pipelineSetName: string | undefined
): pipelineSetName is keyof typeof pipelineSets {
Expand Down

0 comments on commit 6442a19

Please sign in to comment.