-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
91 lines (74 loc) · 2.26 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
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
SHELL := /bin/bash
.DEFAULT_GOAL := help
#######################
# HELPER TARGETS
#######################
.PHONY: help
help: ## help target to show available commands with information
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
#######################
# INSTALLATION
#######################
.PHONY: install
install:
npm i
npx lerna bootstrap --no-ci
.PHONY: download
download:
npm i -g json-serverless
jsonsls
#######################
# SERVER LIB PACKAGE
#######################
.PHONY: start-server
start-server: # execute the library locally
npx lerna run --scope json-serverless-lib --stream start
#######################
# CLI PACKAGE
#######################
.PHONY: start-cli
start-cli: # execute locally via cli run command
make install
npx lerna run --scope json-serverless --stream start
#######################
# TEMPLATE PACKAGE
#######################
.PHONY: start-template
start-template: # execute the stack via serverless offline / serverless framework (needs to be deployed once in advance)
lerna bootstrap
npx lerna run --scope json-serverless-template --stream start
#######################
# CICD COMMANDS
#######################
.PHONY: fake-credentials
fake-credentials:
mkdir -p ~/.aws
touch ~/.aws/credentials
echo -e "[default]\naws_access_key_id=xxxx\naws_secret_access_key=xxx" > ~/.aws/credentials
echo -e "[profile default]\nregion=eu-central-1" > ~/.aws/config
.PHONY: publish
publish:
ifndef GH_TOKEN
$(error GH_TOKEN is undefined)
endif
make install
git status
npx lerna version patch -m "chore(release): Travis CI update [ci skip]" --include-merged-tags --force-publish --conventional-commits --create-release github --yes --git-remote pub
npx lerna publish from-git --yes
#######################
# PUBLISH
#######################
.PHONY: publish-manually
publish-manually:
ifndef GH_TOKEN
$(error GH_TOKEN is undefined)
endif
make install
npx lerna version --include-merged-tags --force-publish --conventional-commits --create-release github
npx lerna publish from-git --yes
.PHONY: cleanup
cleanup:
rm -rf node_modules
cd packages/cli && rm -rf node_modules
cd packages/template && rm -rf node_modules
cd packages/server && rm -rf node_modules