diff --git a/cmd/wcloud/types.go b/cmd/wcloud/types.go index 16e6b2622c..bb0e186604 100644 --- a/cmd/wcloud/types.go +++ b/cmd/wcloud/types.go @@ -21,4 +21,12 @@ type Config struct { RepoPath string `json:"repo_path" yaml:"repo_path"` RepoKey string `json:"repo_key" yaml:"repo_key"` KubeconfigPath string `json:"kubeconfig_path" yaml:"kubeconfig_path"` + + Notifications []NotificationConfig `json:"notifications" yaml:"notifications"` +} + +// NotificationConfig describes how to send notifications +type NotificationConfig struct { + SlackWebhookURL string `json:"slack_webhook_url" yaml:"slack_webhook_url"` + SlackUsername string `json:"slack_username" yaml:"slack_username"` } diff --git a/files-with-type b/files-with-type index d969f44052..0c7dcbb092 100755 --- a/files-with-type +++ b/files-with-type @@ -10,4 +10,4 @@ mime_type=$1 shift -find "$@" -print0 -type f |xargs -0 file --mime-type | grep "${mime_type}" | sed -e 's/:.*$//' +git ls-files | grep -vE '^vendor/' | xargs file --mime-type | grep "${mime_type}" | sed -e 's/:.*$//' diff --git a/lint b/lint index e807f88241..eeca6653f7 100755 --- a/lint +++ b/lint @@ -166,7 +166,7 @@ function lint_files { function list_files { if [ $# -gt 0 ]; then - find "$@" -type f | grep -vE '(^\./\.git|^\./\.pkg|/vendor/|/node_modules/|\.codecgen\.go$|\.generated\.go$)' + git ls-files --exclude-standard | grep -v '^vendor/' else git diff --cached --name-only fi diff --git a/test b/test index 61791772b6..f8d76c56bc 100755 --- a/test +++ b/test @@ -1,6 +1,6 @@ #!/bin/bash -set -ex +set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" GO_TEST_ARGS=( -tags netgo -cpu 4 -timeout 8m ) @@ -47,7 +47,8 @@ fi fail=0 -TESTDIRS=( $(find . -type f -name '*_test.go' -print0 | xargs -0 -n1 dirname | grep -vE '^\./(\.git|vendor|prog|experimental)/' | sort -u) ) +# NB: Relies on paths being prefixed with './'. +TESTDIRS=( $(git ls-files -- '*_test.go' | grep -vE '^(vendor|prog|experimental)/' | xargs -n1 dirname | sort -u | sed -e 's|^|./|') ) # If running on circle, use the scheduler to work out what tests to run on what shard if [ -n "$CIRCLECI" ] && [ -z "$NO_SCHEDULER" ] && [ -x "$DIR/sched" ]; then