Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .buildkite/pipeline.version-bump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,50 @@ steps:
field: ".version"
expected_value: "${NEW_VERSION}-SNAPSHOT"
polling_interval: "30"

- label: "Generate Fetch master DRA Artifacts step"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I pointed at elastic/beats#52435 (review)

let's move the logic to a BK plugin, why? because BK plugins can simplify the usage, support tests and avoid inline scripts to create dynamic pipeline steps that cannot be tested easily.

key: generate-master-dra-check
if: build.env("WORKFLOW") == "minor"
depends_on: fetch-dra-artifacts
agents:
image: docker.elastic.co/release-eng/wolfi-build-essential-release-eng:latest
cpu: 250m
memory: 512Mi
ephemeralStorage: 1Gi
command: |
IFS='.' read -r major minor patch <<EOF
$${NEW_VERSION}
EOF
for part in "$$major" "$$minor" "$$patch"; do
case "$$part" in
''|*[!0-9]*) echo "ERROR: NEW_VERSION must be MAJOR.MINOR.PATCH, got $${NEW_VERSION}" >&2; exit 1 ;;
esac
done
next_main="$$major.$$((minor + 1)).0"
echo "Waiting for $$next_main-SNAPSHOT on master"
cat <<EOF | buildkite-agent pipeline upload
steps:
- label: "Fetch master DRA Artifacts"
key: fetch-master-dra-artifacts
depends_on: generate-master-dra-check
agents:
image: docker.elastic.co/release-eng/wolfi-build-essential-release-eng:latest
cpu: 250m
memory: 512Mi
ephemeralStorage: 1Gi
command:
- echo "Polling $$next_main-SNAPSHOT on master..."
timeout_in_minutes: 240
retry:
automatic:
- exit_status: "*"
limit: 2
manual:
permit_on_passed: true
plugins:
- elastic/json-watcher#v1.0.0:
url: "https://storage.googleapis.com/elastic-artifacts-snapshot/fleet-server/latest/master.json"
field: ".version"
expected_value: "$$next_main-SNAPSHOT"
polling_interval: "30"
EOF