Skip to content

Commit

Permalink
attempt at rust util; ended up doing bash
Browse files Browse the repository at this point in the history
  • Loading branch information
dougch committed Feb 18, 2025
1 parent 688e58a commit 51c8810
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
11 changes: 11 additions & 0 deletions codebuild/utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "utils"
version = "0.1.0"
edition = "2021"

[dependencies]
aws-config = "1.5.16"
aws-sdk-codebuild = "1.75.0"
aws-sdk-dynamodb = "1.65.0"
rust-analyzer = "0.0.1"
tokio = { version = "1", features = ["full"] }
22 changes: 22 additions & 0 deletions codebuild/utils/specs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
#
#

set -eu
BUILDS=(
"AddressSanitizer"
"S2nIntegrationV2SmallBatch"
"Valgrind"
"s2nFuzzBatch"
"s2nGeneralBatch"
"kTLS"
"Openssl3fipsWIP"
)
buildspec() {
aws codebuild batch-get-projects --name $1 | jq '.projects[].source.buildspec'
}

for each in ${BUILDS[@]}; do
echo -e "$each\t"
buildspec $each
done;
28 changes: 28 additions & 0 deletions codebuild/utils/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use aws_config::meta::region::RegionProviderChain;
use aws_config::BehaviorVersion;
use aws_sdk_codebuild::{Client, Error};
use tokio::{io::AsyncWriteExt, net::TcpStream};

#[tokio::main]
async fn main() -> Result<(), Error> {
let region_provider = RegionProviderChain::default_provider().or_else("us-west-2");
let config = aws_config::defaults(BehaviorVersion::latest())
.region(region_provider)
.load()
.await;
let client = Client::new(&config);

let resp = client.batch_get_projects().set_names("s2nGeneralBatch").send().await?;
println!("Buildspecs:");

let names = resp.projects();

for name in names {
println!(" {:?}", name.source());
}

println!();
println!("Found {} tables", names.len());

Ok(())
}

0 comments on commit 51c8810

Please sign in to comment.