-
Notifications
You must be signed in to change notification settings - Fork 175
buildkite: run DRA if any changes #8552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -167,6 +167,7 @@ steps: | |||
env: | |||
DRA_PROJECT_ID: "elastic-agent-package" | |||
DRA_PROJECT_ARTIFACT_ID: "agent-package" | |||
DRA_DRY_RUN: "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the signature for the env variable value. Besides, let's avoid scripted env variables and use the env BK step scope instead.
WORKFLOW="${DRA_WORKFLOW:=""}" | ||
COMMIT="${DRA_COMMIT:="${BUILDKITE_COMMIT:=""}"}" | ||
BRANCH="${DRA_BRANCH:="${BUILDKITE_BRANCH:=""}"}" | ||
PACKAGE_VERSION="${DRA_VERSION:="${BEAT_VERSION:=""}"}" | ||
VERSION_QUALIFIER="${VERSION_QUALIFIER:=""}" | ||
|
||
# force main branch on PR's or it won't execute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need this but BUILDKITE_BRANCH
, and in our case, I use DRA_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
in the .buildkite/pipeline.yml
itself
BRANCH=main | ||
DRY_RUN="--dry-run" | ||
echo "+++ Running in PR and setting branch main and --dry-run" | ||
if [[ "${DRA_DRY_RUN:="false"}" == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the same approach as done in another place:
@@ -159,7 +159,7 @@ metadata: | |||
description: Buildkite pipeline for packaging Elastic Agent package | |||
links: | |||
- title: Pipeline | |||
url: https://buildkite.com/elastic/elastic-agent | |||
url: https://buildkite.com/elastic/elastic-agent-package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes a typo
# don't run snapshot builds with prereleases (non empty VERSION_QUALIFIER) unless forced (RUN_SNAPSHOT=true) | ||
if: build.env("RUN_SNAPSHOT") == "true" || (build.env('VERSION_QUALIFIER') == null && (build.branch == 'main' || build.branch =~ /^[0-9]+\.[0-9x]+\$/)) | ||
if: (build.env("RUN_SNAPSHOT") == "true" || build.env('VERSION_QUALIFIER') == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run always regardless of the branch.
@@ -26,7 +25,8 @@ function release_manager_login { | |||
export VAULT_ADDR_SECRET VAULT_ROLE_ID_SECRET VAULT_SECRET | |||
} | |||
|
|||
if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-package" ]]; then | |||
# TODO: use the buildkite plugin to access the secrets | |||
if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-package" || "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable the elastic-agent
BK pipeline to run the DRA also, otherwise the release_manager_login
won't work. Hence the reason for adding the TODO
, so we can remove this complex if conditions and use the declarative approach with the BK plugins in a follow-up.
|
What does this PR do?
Why is it important?
This should help with detecting breaking changes on a PR basis related to the packaging, see elastic/beats#44701 (comment).
It's also possible to run with some GH commands, see
elastic-agent/.buildkite/pull-requests.json
Line 45 in 8c31135
Checklist
./changelog/fragments
using the changelog toolDisruptive User Impact
How to test this PR locally
In the CI only
Related issues
Questions to ask yourself