Skip to content

Commit

Permalink
Add a script to produce builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpherrinm committed Jan 16, 2023
1 parent e33e866 commit b3a425f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions build-release.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b3a425f

Please sign in to comment.