-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (56 loc) · 2.52 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
#!/usr/bin/env make
.PHONY: start dev build clean docker-build docker-console build-console
export NODE_ENV=development
# ---------------------------------------------------------------------------------------------------------------------
# CONFIG
# ---------------------------------------------------------------------------------------------------------------------
DOCKER_IMAGE_VERSION=0.1.1
DOCKER_IMAGE_TAG=leovs09/orange-app:$(DOCKER_IMAGE_VERSION)
# ---------------------------------------------------------------------------------------------------------------------
# UTILS
# ---------------------------------------------------------------------------------------------------------------------
clean:
rm -rf dist
# ---------------------------------------------------------------------------------------------------------------------
# GIT
# ---------------------------------------------------------------------------------------------------------------------
git-create-patch:
git diff > ./temporary.patch
git-create-staged-patch:
git diff --cached > ./temporary.patch
git-apply-patch:
git apply ./temporary.patch
# ---------------------------------------------------------------------------------------------------------------------
# DEVELOPMENT
# ---------------------------------------------------------------------------------------------------------------------
dev:
yarn update-schema
yarn generate-api-types
yarn dev
# ---------------------------------------------------------------------------------------------------------------------
# PRODUCTION
# ---------------------------------------------------------------------------------------------------------------------
build:
yarn update-schema
yarn generate-api-types
yarn build
start:
yarn start
# ---------------------------------------------------------------------------------------------------------------------
# DOCKER
# ---------------------------------------------------------------------------------------------------------------------
docker-build:
@docker build -t $(DOCKER_IMAGE_TAG) .
docker-console:
docker-compose run --service-ports orange-app /bin/bash
console: docker-console
docker-console-sudo:
docker run --privileged -p 8080:8080 -u 0 -v ${pwd}:/ws/. -it leovs09/orange-app:0.1.0 /bin/bash
build-console: docker-build docker-console
docker-build-and-push:
echo "Build and pull $(DOCKER_IMAGE_TAG)"
docker build -t orange-app .
docker tag orange-app $(DOCKER_IMAGE_TAG)
docker push $(DOCKER_IMAGE_TAG)
docker-web:
docker-compose run -p 8080:80 web