From 654ff0d8066d9cd7e669bb67f356f25435e79e1d Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Thu, 14 Jun 2018 20:42:51 -0700 Subject: [PATCH] testing script --- cmd/src/test.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 cmd/src/test.sh diff --git a/cmd/src/test.sh b/cmd/src/test.sh new file mode 100755 index 0000000000..c0b48af5c8 --- /dev/null +++ b/cmd/src/test.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +cleanup() { + src orgs members remove -org-id=$(src org get -f '{{.ID}}' -name=abc-org) -user-id=$(src users get -f '{{.ID}}' -username=alice) + src orgs delete -id=$(src orgs get -f '{{.ID}}' -name=abc-org) + src users delete -id=$(src users get -f='{{.ID}}' -username=alice) +} + +cleanup > /dev/null 2>&1 + +set -euf -o pipefail + +unset CDPATH +cd "$(dirname "${BASH_SOURCE[0]}")/../.." # cd to repo root dir + +go install ./cmd/src + +src users create -username=alice -email=alice@example.com +src orgs create -name=abc-org +src orgs members add -org-id=$(src org get -f '{{.ID}}' -name=abc-org) -username=alice +cleanup +