-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.common
53 lines (41 loc) · 1.32 KB
/
Makefile.common
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
SHELL=/bin/bash
PACKAGE=$(shell cat package.json | jq ".name" | sed 's/@trigo\///')
REPO_VERSION:=$(shell cat package.json| jq .version)
info:
@echo "=====> NPM Info"
@echo "Package: $(PACKAGE)"
@echo "Version: ${REPO_VERSION}"
@echo "Published: $$(npm show --json @trigo/$(PACKAGE) | jq -r ".versions | join(\", \")")"
install:
npm install
clean:
rm -rf node_modules/
test:
npm run test
build: .
docker-compose -f docker-compose.test.yml build
lint:
npm run lint
pretty:
npm run prettify
ci-lint: build
@docker-compose -f docker-compose.test.yml run --rm $(PACKAGE) npm run lint; \
test_exit=$$?; \
docker-compose -f docker-compose.test.yml down; \
exit $$test_exit
ci-test: build
@docker-compose -f docker-compose.test.yml run --rm $(PACKAGE); \
test_exit=$$?; \
docker-compose -f docker-compose.test.yml down; \
exit $$test_exit
publish: build
@docker-compose -f docker-compose.test.yml run --rm $(PACKAGE) \
/bin/bash -c 'if [[ $$(npm show --json @trigo/$(PACKAGE) versions) =~ "'$(REPO_VERSION)'" ]]; then \
echo "Version unchanged, no need to publish"; \
else \
npm publish; \
fi'; EXIT_CODE=$$?; \
docker-compose -f docker-compose.test.yml down; \
exit $$EXIT_CODE
will-publish:
$$(npm show --json @trigo/$(PACKAGE) versions) =~ "'$(REPO_VERSION)'"