From 59c0ddcfb83d3bcd888594d30137658d40fc08e0 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Mon, 11 Sep 2017 02:33:13 -0400 Subject: [PATCH] Package binaries, print sha256 hashes --- CHANGELOG.md | 3 +++ README.md | 6 ++++-- build/build-cross.sh | 6 ++++++ build/print-shasum.sh | 9 +++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG.md create mode 100755 build/print-shasum.sh diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2df0162 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# v0.1.0 + +* Initial release diff --git a/README.md b/README.md index b20a727..4ce261b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,10 @@ audit2rbac takes a [Kubernetes audit log](https://kubernetes.io/docs/tasks/debug-application-cluster/audit/) and username as input, and generates [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/) role and binding objects that cover all the API requests made by that user. -audit2rbac is in the nascent stages of development, has [known issues](https://github.com/liggitt/audit2rbac/issues?q=is%3Aissue+is%3Aopen+label%3Abug), and will change internal and external interfaces before a stable release. +audit2rbac is in the nascent stages of development, and will change internal and external interfaces before a stable release. + +* [Release history](CHANGELOG.md) +* [Known issues](https://github.com/liggitt/audit2rbac/issues?q=is%3Aissue+is%3Aopen+label%3Abug) ## User Instructions @@ -49,7 +52,6 @@ audit2rbac is in the nascent stages of development, has [known issues](https://g rolebinding "audit2rbac:my-user" created ``` - ## Developer Instructions Requirements: diff --git a/build/build-cross.sh b/build/build-cross.sh index 85d044d..e3305bb 100755 --- a/build/build-cross.sh +++ b/build/build-cross.sh @@ -80,14 +80,18 @@ for PLATFORM in $PLATFORMS; do BIN_DIR="bin/${GOOS}/${GOARCH}" BIN_FILENAME="${BIN_DIR}/${OUTPUT}" + TAR_FILENAME="bin/${OUTPUT}-${GOOS}-${GOARCH}.tar.gz" if [[ "${GOOS}" == "windows" ]]; then BIN_FILENAME="${BIN_FILENAME}.exe"; fi mkdir -p "${BIN_DIR}" + rm -f "${BIN_FILENAME}" + rm -f "${TAR_FILENAME}" CMD="GOARM=${GOARM} GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${BIN_FILENAME} $($(dirname "${BASH_SOURCE}")/print-ldflags.sh) $@" echo "${CMD}" eval $CMD || FAILURES="${FAILURES} ${PLATFORM}" + tar -czf "${TAR_FILENAME}" "${BIN_FILENAME}" done # eval errors @@ -96,3 +100,5 @@ if [[ "${FAILURES}" != "" ]]; then echo "${SCRIPT_NAME} failed on: ${FAILURES}" exit 1 fi + +$(dirname "${BASH_SOURCE}")/print-shasum.sh \ No newline at end of file diff --git a/build/print-shasum.sh b/build/print-shasum.sh new file mode 100755 index 0000000..0fc6231 --- /dev/null +++ b/build/print-shasum.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +root="$(dirname "${BASH_SOURCE}")/../bin" + +echo "filename | sha256 hash" +echo "-------- | -----------" +for file in $(find $root -name *.tar.gz); do + echo "$(basename $file) | $(shasum -b -a 256 $file | cut -f 1 -d ' ')" +done