ci_presubmit: init

This will be, at some point, a script to run on Gerrit presubmit (ie.
right before merge).

For now, you can manually run it to ensure that Everything At Least
Kinda Works.

Change-Id: I28b305fa81a4ca4a8e94ce4daa06fe9ae0184fe8
This commit is contained in:
q3k 2020-09-25 20:23:53 +00:00
parent f00a701f27
commit e7fca3acd8
2 changed files with 24 additions and 0 deletions

21
ci_presubmit.sh Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# This is a presubmit (on-merge) CI script.
# Currently no CI runs it - so be a good cyborg, and run it before submitting
# changes to hscloud.
set -e -o pipefail
if [ -z "$hscloud_root" ]; then
echo 2>&1 "Please first source env.sh"
exit 1
fi
cd $hscloud_root
# Test critical tools.
tools/install.sh
kubectl version --client=true
kubecfg version
prodaccess --help 2>/dev/null
bazel run //cluster/clustercfg smoketest

View file

@ -225,6 +225,9 @@ def main():
return nodestrap(sys.argv[2:], nocerts=True)
elif mode == "admincreds":
return admincreds(sys.argv[2:])
elif mode == "smoketest":
sys.stdout.write("Smoke test passed.")
return 0
else:
usage()
return 1