Skip to content

Commit

Permalink
smoketest: install the specific apm-server and elastic-agent version …
Browse files Browse the repository at this point in the history
…instead of latest (#11292)
  • Loading branch information
kruskall authored Jul 26, 2023
1 parent 2a2cdc3 commit dd82491
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

set -eo pipefail

LATEST_STACK=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '.versions[-1]')
LATEST_BUILD=$(curl -s "https://artifacts-api.elastic.co/v1/versions/${LATEST_STACK}/builds/" | jq -r '.builds[0]')
VERSION=${1}
if [[ -z ${VERSION} ]] || [[ "${VERSION}" == "latest" ]]; then
VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '.versions[-1]')
fi
LATEST_BUILD=$(curl -s "https://artifacts-api.elastic.co/v1/versions/${VERSION}/builds/" | jq -r '.builds[0]')

curl -s "https://artifacts-api.elastic.co/v1/versions/${LATEST_STACK}/builds/${LATEST_BUILD}/projects/apm-server" | jq -r ".project.packages | {deb: .\"apm-server-${LATEST_STACK}-amd64.deb\".url, rpm: .\"apm-server-${LATEST_STACK}-x86_64.rpm\".url }"
curl -s "https://artifacts-api.elastic.co/v1/versions/${VERSION}/builds/${LATEST_BUILD}/projects/apm-server" | jq -r ".project.packages | {deb: .\"apm-server-${VERSION}-amd64.deb\".url, rpm: .\"apm-server-${VERSION}-x86_64.rpm\".url }"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

set -eo pipefail

LATEST_STACK=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '.versions[-1]')
LATEST_BUILD=$(curl -s "https://artifacts-api.elastic.co/v1/versions/${LATEST_STACK}/builds/" | jq -r '.builds[0]')
VERSION=${1}
if [[ -z ${VERSION} ]] || [[ "${VERSION}" == "latest" ]]; then
VERSION=$(curl -s "https://artifacts-api.elastic.co/v1/versions" | jq -r '.versions[-1]')
fi
LATEST_BUILD=$(curl -s "https://artifacts-api.elastic.co/v1/versions/${VERSION}/builds/" | jq -r '.builds[0]')

curl -s "https://artifacts-api.elastic.co/v1/versions/${LATEST_STACK}/builds/${LATEST_BUILD}/projects/elastic-agent" | jq -r ".project.packages | {deb: .\"elastic-agent-${LATEST_STACK}-amd64.deb\".url, rpm: .\"elastic-agent-${LATEST_STACK}-x86_64.rpm\".url }"
curl -s "https://artifacts-api.elastic.co/v1/versions/${VERSION}/builds/${LATEST_BUILD}/projects/elastic-agent" | jq -r ".project.packages | {deb: .\"elastic-agent-${VERSION}-amd64.deb\".url, rpm: .\"elastic-agent-${VERSION}-x86_64.rpm\".url }"
4 changes: 2 additions & 2 deletions testing/infra/terraform/modules/standalone_apm_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ resource "null_resource" "apm_server_log" {
}

data "external" "latest_elastic_agent" {
program = ["bash", "${path.module}/latest_elastic_agent.sh"]
program = ["bash", "${path.module}/latest_elastic_agent.sh", "${var.stack_version}"]
}

data "external" "latest_apm_server" {
program = ["bash", "${path.module}/latest_apm_server.sh"]
program = ["bash", "${path.module}/latest_apm_server.sh", "${var.stack_version}"]
}

resource "aws_key_pair" "provisioner_key" {
Expand Down

0 comments on commit dd82491

Please sign in to comment.