-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ops] Decouple serverless release from tags (#176505)
## Summary Removes resource def and pipeline for: https://buildkite.com/elastic/kibana-serverless-release Adds a step after deploy tag creation to trigger a GPCTL release flow for the commit hash - this step needs to be emitted because some of its parameters are not available at the time of uploading the original pipeline file. - [x] Test without firing off a release <img width="1250" alt="Screenshot 2024-02-23 at 11 43 08" src="https://github.com/elastic/kibana/assets/4738868/f8b2fd04-8b44-4beb-949e-5f45a3573bc5"> Closes elastic/kibana-operations#59 - see this for the full context. --------- Co-authored-by: Thomas Watson <w@tson.dk>
- Loading branch information
Showing
7 changed files
with
99 additions
and
70 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
12 changes: 0 additions & 12 deletions
12
.buildkite/pipelines/pipeline.kibana-serverless-release.yaml
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
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
49 changes: 49 additions & 0 deletions
49
.buildkite/scripts/serverless/create_deploy_tag/generate_gpctl_trigger.ts
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,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { buildkite } from './shared'; | ||
import { getSelectedCommitHash } from './info_sections/commit_info'; | ||
import { BuildkiteTriggerStep } from '#pipeline-utils'; | ||
|
||
const IS_DRY_RUN = process.env.DRY_RUN?.match(/(1|true)/i); | ||
const REMOTE_SERVICE_CONFIG = `https://raw.githubusercontent.com/elastic/serverless-gitops/main/gen/gpctl/kibana/config.yaml`; | ||
|
||
async function main() { | ||
const selectedSha = getSelectedCommitHash(); | ||
uploadTriggerStep(selectedSha); | ||
} | ||
|
||
function uploadTriggerStep(commitSha: string) { | ||
const triggerStep: BuildkiteTriggerStep = { | ||
label: ':releasethekaken: Trigger GPCTL / Release Kibana', | ||
trigger: 'gpctl-promote', | ||
async: true, | ||
build: { | ||
message: 'Triggered by Kibana serverless release pipeline', | ||
env: { | ||
SERVICE_COMMIT_HASH: commitSha.slice(0, 12), | ||
REMOTE_SERVICE_CONFIG, | ||
}, | ||
}, | ||
}; | ||
|
||
if (IS_DRY_RUN) { | ||
console.log('Dry run: skipping upload of GPCTL trigger step. Step definition:', triggerStep); | ||
} else { | ||
buildkite.uploadSteps([triggerStep]); | ||
} | ||
} | ||
|
||
main() | ||
.then(() => { | ||
console.log('GPCTL Trigger step uploaded.'); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
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