diff --git a/.circleci/config.yml b/.circleci/config.yml index c4cd303ab0..9729d3516d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -909,7 +909,7 @@ jobs: - run: name: Validate Debian Package (AMD64) command: | - sudo .circleci/scripts/package-validation/ubuntu \ + sudo .circleci/scripts/package-validation/debian \ /tmp/workspace/artifacts/influxdb2*-amd64.deb check_package_deb_arm64: @@ -923,7 +923,7 @@ jobs: - run: name: Validate Debian Package (ARM64) command: | - sudo .circleci/scripts/package-validation/ubuntu \ + sudo .circleci/scripts/package-validation/debian \ /tmp/workspace/artifacts/influxdb2*-arm64.deb check_package_rpm: @@ -947,4 +947,4 @@ jobs: command: | export AWS_ACCESS_KEY_ID=$TEST_AWS_ACCESS_KEY_ID export AWS_SECRET_ACCESS_KEY=$TEST_AWS_SECRET_ACCESS_KEY - .circleci/scripts/package-validation/centos << parameters.arch >> /tmp/workspace/artifacts/influxdb2*.<< parameters.arch >>.rpm + .circleci/scripts/package-validation/redhat << parameters.arch >> /tmp/workspace/artifacts/influxdb2*.<< parameters.arch >>.rpm diff --git a/.circleci/scripts/package-validation/ubuntu b/.circleci/scripts/package-validation/debian similarity index 100% rename from .circleci/scripts/package-validation/ubuntu rename to .circleci/scripts/package-validation/debian diff --git a/.circleci/scripts/package-validation/centos b/.circleci/scripts/package-validation/redhat similarity index 94% rename from .circleci/scripts/package-validation/centos rename to .circleci/scripts/package-validation/redhat index 8d758f8ece..8493980a2d 100755 --- a/.circleci/scripts/package-validation/centos +++ b/.circleci/scripts/package-validation/redhat @@ -5,7 +5,11 @@ set -o errexit \ # $1 -> architecture # $2 -> package path -arch="${1}" +case ${1} in + x86_64) arch=x86_64 ;; + aarch64) arch=arm64 ;; +esac + package="$(realpath "${2}")" path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" @@ -16,7 +20,7 @@ terraform_init() { # Unfortunately, CircleCI doesn't offer any RPM based machine images. # This is required to test the functionality of the systemd services. # (systemd doesn't run within docker containers). This will spawn a - # CentOS 9 Stream EC2 instance in AWS. + # Amazon Linux instance in AWS. terraform init terraform apply \ -auto-approve \ diff --git a/.circleci/scripts/package-validation/tf/main.tf b/.circleci/scripts/package-validation/tf/main.tf index 7f31e64968..f949a00960 100644 --- a/.circleci/scripts/package-validation/tf/main.tf +++ b/.circleci/scripts/package-validation/tf/main.tf @@ -23,21 +23,23 @@ provider "aws" { region = "us-east-1" } -data "aws_ami" "centos" { +data "aws_ami" "test_ami" { most_recent = true - # This information is sourced from https://wiki.centos.org/Cloud/AWS - # and should pull the latest AWS-provided CentOS Stream 9 image. filter { name = "name" - values = [format("CentOS Stream 9 %s*", var.architecture)] + values = ["al20*-ami-20*"] } filter { name = "virtualization-type" values = ["hvm"] } + filter { + name = "architecture" + values = [var.architecture] + } - owners = ["125523088429"] + owners = ["137112412989"] } resource "aws_security_group" "influxdb_test_package_sg" { @@ -58,15 +60,15 @@ resource "aws_security_group" "influxdb_test_package_sg" { } } -resource "aws_instance" "centos" { +resource "aws_instance" "test_instance" { count = 1 - ami = data.aws_ami.centos.id + ami = data.aws_ami.test_ami.id instance_type = var.architecture == "x86_64" ? "t2.micro" : "c6g.medium" key_name = "circleci-oss-test" vpc_security_group_ids = [aws_security_group.influxdb_test_package_sg.id] tags = { - Name = format("circleci_%s_centos_%s", var.identifier, var.architecture) + Name = format("circleci_%s_test_%s", var.identifier, var.architecture) } provisioner "file" { @@ -108,5 +110,5 @@ resource "aws_instance" "centos" { } output "node_ssh" { - value = aws_instance.centos.0.public_dns + value = aws_instance.test_instance.0.public_dns }