Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (78 loc) · 3.08 KB
/
Copy pathMakefile
File metadata and controls
96 lines (78 loc) · 3.08 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
LOCAL_SPEC_FILE=./DigitalOcean-public.v2.yaml
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'; \
printf "\nNOTE: Run 'SPEC_FILE=path/to/local/spec make generate' to skip the download and use a local spec file.\n"
.PHONY: download-spec
download-spec: ## Download Latest DO Spec
@echo Downloading published spec; \
touch DigitalOcean-public.v2.yaml && \
curl https://api-engineering.nyc3.digitaloceanspaces.com/spec-ci/DigitalOcean-public.v2.yaml -o $(LOCAL_SPEC_FILE)
.PHONY: clean
clean: ## Remove kiota generated files and directories
@echo Cleaning up generated files and directories; \
rm -rf src/dots/digitalOceanClient.ts src/dots/digitalOceanClient.js src/dots/models src/dots/v2 src/dots/.kiota.log src/dots/kiota-lock.json
.PHONY: dev-dependencies
dev-dependencies: ## Install development tooling
npm install
.PHONY: lint
lint: ## Run linter on code base
@echo Running typescript linter
npm run lint
.PHONY: test
test: ## Running all test cases
@echo Running all test cases
npm test
.PHONY: test-mocked
test-mocked: ## Running mocked test cases
@echo Running all mocked test cases
npm run test:mock
.PHONY: test-integration-all
test-integration-all: ## Running mocked test cases
@echo Running all integration test cases
npm run test:integration
.PHONY: test-integration
test-integration: ## Running single integration test case
@echo Running tests/integration/$(file) test cases
npm run test:single tests/integration/$(file)
.PHONY: docs_clean
docs_clean: ## Remove generated documents
@echo Cleaning up generated document; \
rm -rf docs
.PHONY: generate-docs
generate-docs: ## generate typescript client documentation
@echo Running typescript linter
npm run docs
.PHONY: bump_version
bump_version: ## Bumps the version
@echo "==> BUMP=${BUMP} bump_version"
@echo ""
@ORIGIN=${ORIGIN} scripts/bumpversion.sh
.PHONY: generate
ifndef SPEC_FILE
generate: SPEC_FILE = $(LOCAL_SPEC_FILE)
generate: download-spec ## Generates the typescript client using the latest published spec first.
endif
generate: dev-dependencies
@printf "=== Generating client with spec: $(SPEC_FILE)\n"; \
printf "=== Kiota: ./src/dots. Post-gen inference: ./src/inference-gen (from bundled spec).\n\n"; \
kiota generate -l typescript -d $(SPEC_FILE) -c DigitalOceanClient -o ./src/dots && \
node scripts/postgen-inference.mjs "$(SPEC_FILE)"
.PHONY: tag
tag: ## Tags a GA release (vX.Y.Z from package.json)
@echo "==> ORIGIN=${ORIGIN} COMMIT=${COMMIT} tag"
@echo ""
@ORIGIN=${ORIGIN} scripts/tag.sh
.PHONY: beta_tag
beta_tag: ## Tags a beta release (vX.Y.Z-beta.N) from the current branch
@echo "==> ORIGIN=${ORIGIN} COMMIT=${COMMIT} beta_tag"
@echo ""
@ORIGIN=${ORIGIN} scripts/beta_tag.sh
.PHONY: _install_github_release_notes
_install_github_release_notes:
@GO111MODULE=on go install github.com/digitalocean/github-changelog-generator@latest
.PHONY: changes
changes: _install_github_release_notes
@echo "==> Merged PRs since last release"
@echo ""
@github-changelog-generator -org digitalocean -repo dots