Skip to content

Commit

Permalink
Merge branch 'main' into functionaltests
Browse files Browse the repository at this point in the history
  • Loading branch information
endorama authored Jan 17, 2025
2 parents b97cf14 + 9e6c6c6 commit 7e6ec11
Show file tree
Hide file tree
Showing 82 changed files with 1,297 additions and 940 deletions.
21 changes: 10 additions & 11 deletions .buildkite/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ steps:
steps:
- label: "Package x86_64"
key: "package-x86-64"
command: ".buildkite/scripts/package.sh {{matrix.type}}"
command: ".buildkite/scripts/package.sh {{matrix}}"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "c2-standard-16"
matrix:
setup:
type:
- "snapshot"
- "staging"
- "snapshot"
- "staging"
artifact_paths:
- "build/distributions/**/*"
- "build/dependencies*.csv"
Expand All @@ -34,16 +32,14 @@ steps:

- label: "Package aarch64"
key: "package-arm"
command: ".buildkite/scripts/package.sh {{matrix.type}}"
command: ".buildkite/scripts/package.sh {{matrix}}"
agents:
provider: "aws"
imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
instanceType: "t4g.2xlarge"
matrix:
setup:
type:
- "snapshot"
- "staging"
- "snapshot"
- "staging"
artifact_paths:
- "build/distributions/**/*"
retry:
Expand All @@ -52,11 +48,14 @@ steps:

- label: "DRA"
key: "dra"
command: ".buildkite/scripts/dra.sh"
command: ".buildkite/scripts/dra.sh {{matrix}}"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "c2-standard-16"
matrix:
- "snapshot"
- "staging"
depends_on:
- step: "package"
allow_failure: false
24 changes: 17 additions & 7 deletions .buildkite/scripts/dra.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

set -eo pipefail

## Read current version.
VERSION=$(make get-version)
# Either staging or snapshot
TYPE="$1"

## Read current version without the qualifier
VERSION=$(make get-version-only)

echo "--- Restoring Artifacts"
buildkite-agent artifact download "build/**/*" .
Expand Down Expand Up @@ -72,7 +75,9 @@ fi
dra() {
local workflow=$1
local command=$2
local qualifier=${ELASTIC_QUALIFIER:-""}
echo "--- Run release manager $workflow (DRA command: $command)"
set -x
docker run --rm \
--name release-manager \
-e VAULT_ADDR="${VAULT_ADDR_SECRET}" \
Expand All @@ -86,8 +91,9 @@ dra() {
--commit $BUILDKITE_COMMIT \
--workflow $workflow \
--artifact-set main \
--qualifier "$qualifier" \
--version $VERSION | tee rm-output.txt

set +x
# Create Buildkite annotation similarly done in Beats:
# https://github.com/elastic/beats/blob/90f9e8f6e48e76a83331f64f6c8c633ae6b31661/.buildkite/scripts/dra.sh#L74-L81
if [[ "$command" == "collect" ]]; then
Expand All @@ -101,8 +107,12 @@ dra() {
fi
}

dra "snapshot" "$dra_command"
if [[ "${DRA_BRANCH}" != "main" && "${DRA_BRANCH}" != "8.x" ]]; then
echo "DRA_BRANCH is neither 'main' nor '8.x'"
dra "staging" "$dra_command"
if [[ "${TYPE}" == "staging" ]]; then
if [[ "${DRA_BRANCH}" != "8.x" ]]; then
echo "${DRA_BRANCH} is not '8.x'"
dra "${TYPE}" "$dra_command"
fi
else
# NOTE: qualifier is not needed for snapshots, let's unset it.
dra "snapshot" "$dra_command" ""
fi
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45.0.5
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
with:
files: .go-version

Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/mergify-labels-copier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: mergify backport labels copier

on:
pull_request:
types:
- opened

permissions:
contents: read

jobs:
mergify-backport-labels-copier:
runs-on: ubuntu-latest
if: startsWith(github.head_ref, 'mergify/bp/')
permissions:
# Add GH labels
pull-requests: write
# See https://github.com/cli/cli/issues/6274
repository-projects: read
steps:
- uses: elastic/oblt-actions/mergify/labels-copier@v1
with:
excluded-labels-regex: "^backport-*"
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ PYTHON_BIN:=$(PYTHON_VENV_DIR)/bin
PYTHON=$(PYTHON_BIN)/python
CURRENT_DIR=$(shell dirname $(shell readlink -f $(firstword $(MAKEFILE_LIST))))

# Support DRA qualifier with the following environment variable.
ELASTIC_QUALIFIER?=

# Create a local config.mk file to override configuration.
-include config.mk

Expand All @@ -38,6 +41,7 @@ APM_SERVER_BINARIES:= \
# Strip binary and inject the Git commit hash and timestamp.
LDFLAGS := \
-s \
-X github.com/elastic/apm-server/internal/version.qualifier=$(ELASTIC_QUALIFIER) \
-X github.com/elastic/beats/v7/libbeat/version.commit=$(GITCOMMIT) \
-X github.com/elastic/beats/v7/libbeat/version.buildTime=$(GITCOMMITTIMESTAMP)

Expand Down Expand Up @@ -139,6 +143,11 @@ endif
get-version:
@echo $(APM_SERVER_VERSION)

## get-version-only : Get the apm server version without the qualifier
.PHONY: get-version-only
get-version-only:
@echo $(APM_SERVER_ONLY_VERSION)

# update-go-version updates .go-version, documentation, and build files
# to use the most recent patch version for the major.minor Go version
# defined in go.mod.
Expand Down
Loading

0 comments on commit 7e6ec11

Please sign in to comment.