From 09292c8cb1ced0bd7c699c8eb8cbc1bec8e896a1 Mon Sep 17 00:00:00 2001 From: Matthew McPherrin Date: Mon, 16 Jan 2023 17:36:31 -0500 Subject: [PATCH] Add a script to produce builds --- build-release.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 build-release.sh diff --git a/build-release.sh b/build-release.sh new file mode 100755 index 0000000..70bf380 --- /dev/null +++ b/build-release.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -euxo pipefail +# Build the pair of zip files to upload to lambda +# TODO: This really ought to be something like a github action that does a release. +# TODO: But it's better than mattm just knowing the commands! + +mkdir -p build +DIR=$(mktemp -d "build/build-$(git rev-parse --short HEAD)-XXXXXX") +echo "Building in $DIR" + +# Churner is just a binary +mkdir -p "$DIR/churner" +go build -o "$DIR/churner/churner" lambda/churner/churner.go +# zip +pushd "$DIR/churner" +zip churner.zip churner +popd + + +# Checker binary and certs +mkdir -p "$DIR/checker" +go build -o "$DIR/checker/checker" lambda/checker/checker.go +cp checker/testdata/stg-e1.pem "$DIR/checker/stg-int-e1-by-x2.pem" +cp checker/testdata/stg-r3.pem "$DIR/checker/stg-int-r3-by-x1.pem" +cp checker/testdata/e1.pem "$DIR/checker/prod-int-e1-by-x2.pem" +cp checker/testdata/r3.pem "$DIR/checker/prod-int-r3-by-x1.pem" +# zip +pushd "$DIR/checker" +zip checker.zip checker ./*.pem +popd