fix: use Amazon EC2 Image instead of CentOS EC2 Image (#24181)
parent
7616ca642b
commit
1bb310e606
|
@ -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
|
||||
|
|
|
@ -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 \
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue