This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
87 lines (68 loc) · 2.68 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
default: install build
install:
@echo Installing npm packages...
@npm install
build:
@echo Building project...
@npm run build
watch:
@echo Starting file watcher...
@npm run watch
dev:
@echo Starting dev server
@npm run dev
init:
@cp constants-example.js constants.js
upload-images:
@rsync -r ./public/images/assets/* [email protected]:/home/ascend/ascendntnu-web/images/assets
@rsync -r ./public/images/teams/20* [email protected]:/home/ascend/ascendntnu-web/images/teams
upload-image:
@rsync -r ./public/images/assets/${folder}/${file} [email protected]:/home/ascend/ascendntnu-web/images/assets/${folder}
#To upload a folder, just specify folder
#Example usage file: make upload folder=testfolder file=testfile.txt
#Example usage folder make upload folder=testfolder
upload:
@rsync -r ./${folder}/${file} [email protected]:/home/ascend/ascendntnu-web/${folder}
download-images:
@mkdir -p ./public/images/assets
@rsync -r [email protected]:/home/ascend/ascendntnu-web/images/assets/* ./public/images/assets
@mkdir -p ./public/images/teams
@rsync -r [email protected]:/home/ascend/ascendntnu-web/images/teams/20* ./public/images/teams
docker-baseimage:
@echo Building a docker image...
@docker build -t ascend/ascend-web-baseimage -f Dockerfile.baseimage .
docker-image:
@echo Building a docker image...
@docker build -t ascend/ascend-web .
docker-image-removed:
@echo Removing docker image...
@docker rmi ascend/ascend-web -f
docker-container:
@if [ `docker ps -a | grep ascend-web-container | wc -l` -ne "0" ]; then \
echo "Found existing ascend-web-container. Replacing it..."; \
make docker-container-removed; \
fi
@echo Creating a container from ascend-web image...
@docker run --name ascend-web-container -d -p 8081:8080 ascend/ascend-web
@echo Created container successfully!
docker-container-prod:
@if [ `docker ps -a | grep ascend-web-container-prod | wc -l` -ne "0" ]; then \
echo "Found existing ascend-web-container-prod. Replacing it..."; \
make docker-container-prod-removed; \
fi
@echo Creating a container from ascend-web image...
@docker run --name ascend-web-container-prod -d -p 8080:8080 ascend/ascend-web
@echo Created production container successfully!
docker-container-removed:
@echo Removing container...
@docker stop ascend-web-container
@docker rm ascend-web-container
docker-container-prod-removed:
@echo Removing production container...
@docker stop ascend-web-container-prod
@docker rm ascend-web-container-prod
docker-enter-container:
@docker exec -it ascend-web-container /bin/bash
docker-enter-container-prod:
@docker exec -it ascend-web-container-prod /bin/bash
.PHONY: default install build watch dev