Commit 2b81cf8d authored by Christopher Schinnerl's avatar Christopher Schinnerl

more comments and set -e in deploy.sh

parent f0602126
Pipeline #32459301 passed with stages
in 28 minutes and 11 seconds
......@@ -6,36 +6,36 @@ PRIVKEY=$1
rm -rf artifacts
mkdir artifacts
# Return first error encountered by any command.
set -e
# Generate public key from private key.
echo "$PRIVKEY" | openssl rsa -in - -outform PEM -pubout -out artifacts/pubkey.pem
if [ $? -ne 0 ]; then
exit $?
fi
# Build binaries and sign them.
for arch in amd64 arm; do
for os in darwin linux windows; do
for pkg in siac siad; do
# Ignore unsupported arch/os combinations.
if [ "$arch" == "arm" ]; then
if [ "$os" == "windows" ] || [ "$os" == "darwin" ]; then
continue
fi
fi
# Binaries are called 'siac' and i'siad'.
bin=$pkg
# Different naming convention for windows.
if [ "$os" == "windows" ]; then
bin=${pkg}.exe
fi
# Build binary.
GOOS=${os} GOARCH=${arch} go build -tags='netgo' -o artifacts/$arch/$os/$bin ./cmd/$pkg
if [ $? -ne 0 ]; then
exit $?
fi
# Sign binary.
echo "$PRIVKEY" | openssl dgst -sha256 -sign - -out artifacts/$arch/$os/$bin.sha256 artifacts/$arch/$os/$bin
if [ $? -ne 0 ]; then
exit $?
fi
done
done
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment