diff --git a/distro/check_build.sh b/distro/check_build.sh new file mode 100755 index 0000000..bfcae6d --- /dev/null +++ b/distro/check_build.sh @@ -0,0 +1,59 @@ +#!/bin/bash -ef +# +# This is a temporary hack to verify the distribution archive is sound. +# +# The intent is to create a rule which does this and add to +# rules_pkg. Comments within it are mostly for future me +# while writing that. + +TARBALL=$(bazel build //distro:distro 2>&1 | grep 'rules_license-.*\.tar\.gz' | sed -e 's/ //g') +REPO_NAME='rules_license' + +# This part can be standard from the rule + + +TARNAME=$(basename "$TARBALL") + +TMP=$(mktemp -d) +trap '/bin/rm -rf "$TMP"; exit 0' 0 1 2 3 15 + +cp "$TARBALL" "$TMP" + +cd "$TMP" +cat >WORKSPACE <BUILD <LICENSE + +# Then a list of commands to run. This can be a template +# too so we can substitute the path to bazel. +bazel build ... +bazel build @rules_license//rules/... +bazel build @rules_license//licenses/... +bazel query @rules_license//licenses/generic/... +bazel query ...