-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
29 lines (22 loc) · 1.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
build:
go build
cross-compile:
gox -os="linux" -arch="386 amd64 arm arm64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}"
gox -os="darwin" -arch="386 amd64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}"
gox -os="windows" -arch="386 amd64" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}"
package:
goxc
release: clean cross-compile package
ghr -draft -token ${GITHUB_TOKEN} ${VERSION} dist/snapshot/
@echo "released as draft"
clean:
rm -f spanner-cli
rm -rf dist/
go clean -testcache
run:
./spanner-cli -p ${PROJECT} -i ${INSTANCE} -d ${DATABASE}
test:
@SPANNER_CLI_INTEGRATION_TEST_PROJECT_ID=${PROJECT} SPANNER_CLI_INTEGRATION_TEST_INSTANCE_ID=${INSTANCE} SPANNER_CLI_INTEGRATION_TEST_DATABASE_ID=${DATABASE} SPANNER_CLI_INTEGRATION_TEST_CREDENTIAL=${CREDENTIAL} go test -v ./...
setup-emulator:
curl -s "${SPANNER_EMULATOR_HOST_REST}/v1/projects/${PROJECT}/instances" --data '{"instanceId": "'${INSTANCE}'"}'
curl -s "${SPANNER_EMULATOR_HOST_REST}/v1/projects/${PROJECT}/instances/${INSTANCE}/databases" --data '{"createStatement": "CREATE DATABASE `'${DATABASE}'`"}'