-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
37 lines (28 loc) · 1.17 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
.PHONY: dep test build release upload
YARN_FLAGS ?= --non-interactive --no-progress --silent --emoji false
YARN = yarn $(YARN_FLAGS)
APP ?= corteza-server-corredor
BUILD_FLAVOUR ?= corteza
BUILD_DEST_DIR = dist
BUILD_TIME ?= $(shell date +%FT%T%z)
BUILD_VERSION ?= $(shell git describe --tags --abbrev=0)
BUILD_NAME = corteza-server-corredor-$(BUILD_VERSION)
RELEASE_NAME = $(BUILD_NAME).tar.gz
RELEASE_EXTRA_FILES ?= README.* LICENSE CONTRIBUTING.md DCO .env.example
RELEASE_PKEY ?= .upload-rsa
dep:
$(YARN) install
test:
$(YARN) lint
$(YARN) test:unit
release:
@ mkdir -p .tmp/$(APP)
# @ cp -r $(RELEASE_EXTRA_FILES) $(BUILD_DEST_DIR) node_modules .tmp/$(APP)/
@ cp -r $(RELEASE_EXTRA_FILES) package.json .eslintrc.js .mocharc.js tsconfig.json yarn.lock src node_modules .tmp/$(APP)/
@ tar -C .tmp -czf $(RELEASE_NAME) $(APP)
upload: $(RELEASE_PKEY)
@ echo "put *.tar.gz" | sftp -q -o "StrictHostKeyChecking no" -i $(RELEASE_PKEY) $(RELEASE_SFTP_URI)
@ rm -f $(RELEASE_PKEY)
$(RELEASE_PKEY):
@ echo $(RELEASE_SFTP_KEY) | base64 -d > $(RELEASE_PKEY)
@ chmod 0400 $@