Skip to content
Merged
20 changes: 20 additions & 0 deletions .buildkite/pull_request_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,26 @@ steps:
manual:
allowed: true

- label: "Observability SRE container smoke test"
key: "observability-sre-container-smoke-test"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
command: |
set -euo pipefail
source .buildkite/scripts/common/vm-agent.sh
# Provides QUALIFIED_VERSION
source ci/version-qualifier.sh
./gradlew --stacktrace artifactDockerObservabilitySRE
docker run docker.elastic.co/logstash/logstash-observability-sre:${QUALIFIED_VERSION} \
logstash -e 'input { generator { count => 3 } } output { stdout { codec => rubydebug } }'

- label: ":lab_coat: Integration Tests - FIPS mode / part 1"
key: "integration-tests-fips-part-1"
agents:
Expand Down
23 changes: 23 additions & 0 deletions ci/version-qualifier.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# *********************************************************
# This file provides the qualified version, considering the
# contents of /versions.yml, VERSION_QUALIFIER, and RELEASE
# *********************************************************

set -euo pipefail

export QUALIFIED_VERSION="$(
# extract logstash version from versions.yml
printf "$(awk -F':' '{ if ("logstash" == $1) { gsub(/^ | $/,"",$2); printf $2; exit } }' versions.yml)"

# append the VERSION_QUALIFIER if it is present
printf "${VERSION_QUALIFIER:+-${VERSION_QUALIFIER}}"

# add the SNAPSHOT tag unless RELEASE=1
[[ "${RELEASE:-0}" == "1" ]] || printf "-SNAPSHOT"
)"

if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then
printf "${QUALIFIED_VERSION}"
fi
Copy link
Member

Choose a reason for hiding this comment

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

It's landing in a different path in #17311, but this is the fully-portable version that will likely land there:

Suggested change
#!/usr/bin/env bash
# *********************************************************
# This file provides the qualified version, considering the
# contents of /versions.yml, VERSION_QUALIFIER, and RELEASE
# *********************************************************
set -euo pipefail
export QUALIFIED_VERSION="$(
# extract logstash version from versions.yml
printf "$(awk -F':' '{ if ("logstash" == $1) { gsub(/^ | $/,"",$2); printf $2; exit } }' versions.yml)"
# append the VERSION_QUALIFIER if it is present
printf "${VERSION_QUALIFIER:+-${VERSION_QUALIFIER}}"
# add the SNAPSHOT tag unless RELEASE=1
[[ "${RELEASE:-0}" == "1" ]] || printf "-SNAPSHOT"
)"
if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then
printf "${QUALIFIED_VERSION}"
fi
#!/usr/bin/env bash
# ********************************************************
# Source this script to get the QUALIFIED_VERSION env var
# or execute it to receive the qualified version on stdout
# ********************************************************
set -euo pipefail
export QUALIFIED_VERSION="$(
# Extract the version number from the version.yml file
# e.g.: 8.6.0
printf '%s' "$(awk -F':' '{ if ("logstash" == $1) { gsub(/^ | $/,"",$2); printf $2; exit } }' versions.yml)"
# Qualifier is passed from CI as optional field and specify the version postfix
# in case of alpha or beta releases for staging builds only:
# e.g: 8.0.0-alpha1
printf '%s' "${VERSION_QUALIFIER:+-${VERSION_QUALIFIER}}"
# add the SNAPSHOT tag unless WORKFLOW_TYPE=="staging" or RELEASE=="1"
if [[ ! ( "${WORKFLOW_TYPE:-}" == "staging" || "${RELEASE:+$RELEASE}" == "1" ) ]]; then
printf '%s' "-SNAPSHOT"
fi
)"
# if invoked directly, output the QUALIFIED_VERSION to stdout
if [[ "$0" == "${BASH_SOURCE:-${ZSH_SCRIPT:-}}" ]]; then
printf '%s' "${QUALIFIED_VERSION}"
fi

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool. I think i'm going to just hard code it to 8.19.0-SNAPSHOT for now and we can update once that refactor gets merged upstream.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
logstash-codec-json
logstash-codec-multiline
logstash-codec-plain
logstash-codec-rubydebug
logstash-filter-age
logstash-filter-date
logstash-filter-drop
Expand All @@ -9,7 +10,9 @@ logstash-filter-grok
logstash-filter-json
logstash-filter-mutate
logstash-input-beats
logstash-input-generator
logstash-input-pipeline
logstash-output-elasticsearch
logstash-output-pipeline
logstash-output-stdout
logstash-patterns-core