Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
**/target
**/*.rs.bk
Cargo.lock

### Terraform ###
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*
25 changes: 25 additions & 0 deletions assets/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions assets/aarch64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
set -euxo pipefail

if [[ -z "$AWS_ACCESS_KEY_ID" || -z "$AWS_SECRET_ACCESS_KEY" ]]; then
echo "Must provide AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY"
exit 1
fi

cd "$(dirname "$0")"

terraform plan
terraform apply -auto-approve
public_ip=$(terraform output --raw public_ip)
sleep 30
ssh ec2-user@$public_ip "
sudo yum update -y &&
sudo yum groupinstall -y 'Development Tools' &&
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal -y &&
source "\$HOME/.cargo/env" &&
git clone https://github.com/nickbabcock/highway-rs.git &&
cd highway-rs &&
cargo test"

if [[ $? = 0 ]]; then
read -p "Test successful, preserve instance? (y/N): " -n 1 -r -t 300
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
terraform destroy -auto-approve
fi
else
echo "Test failed"
fi
22 changes: 22 additions & 0 deletions assets/aarch64.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}

provider "aws" {
region = "us-east-1"
}

resource "aws_instance" "highway_aarch64" {
ami = "ami-055859c8e0f361065"
instance_type = "t4g.small"
key_name = "me"
}

output "public_ip" {
value = aws_instance.highway_aarch64.public_ip
}