This repository was archived by the owner on Oct 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (49 loc) · 2.07 KB
/
Copy pathMakefile
File metadata and controls
63 lines (49 loc) · 2.07 KB
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
####################################################################################################
# https://www.gnu.org/software/make/ #
####################################################################################################
$(eval deployerMaschine=$(shell hostname))
$(eval currentBranch=$(shell git symbolic-ref --short -q HEAD))
notificationPayload = {\
\"embeds\":\
\[\
{\"title\":\"Webgamers $(env)\",\
\"description\":\"Deploy Webgamers $(env).\",\
\"color\":16738816\
\}\
\]\
}
localPath = .
rsyncSwitches = --checksum -rlvz4 --delete
rsyncLog = build/rsync.log
ifeq ($(env), stage)
include Makefile.stage
endif
ifeq ($(env), prod)
include Makefile.prod
endif
default:
@echo "usage: make env=(prod|stage) <rule>"
@echo "list rules: make help"
help:
@printf "list of rules:\n"
@printf " \033[0;36mdeploy\033[0m deploy to instance\n"
@printf " \033[0;36mdeploy-lookup\033[0m deploy to instance (dry-run mode)\n"
@printf " \033[0;36mclear\033[0m clear cache and tmp directories\n"
_prepare:
@mkdir -p build
deploy-lookup: _prepare
@printf "\033[0;36mdeploy-lookup:\033[0m\n"
@RSYNC_PASSWORD=$(rsyncPass) \
rsync -n $(rsyncSwitches) $(rsyncExcludes) $(localPath) \
rsync://$(rsyncUser)@$(host)/$(rsyncShare)$(rsyncPath) | tee $(rsyncLog)
@printf "\033[0;32m->see $(rsyncLog) for details\033[0m\n"
deploy: _deploy
_deploy:
@printf "\033[0;36mdeploy:\033[0m\n\033[0m\n"
@RSYNC_PASSWORD=$(rsyncPass) \
rsync $(rsyncSwitches) $(rsyncExcludes) $(localPath) \
rsync://$(rsyncUser)@$(host)/$(rsyncShare)$(rsyncPath) | tee $(rsyncLog)
@printf "\033[0;32m->see $(rsyncLog) for details\033[0m\n"
discord-changelog:
curl -H "Content-Type: application/json" --insecure -X POST --data-urlencode -d '{"embeds":[{"title":"Webgamers","description":"Wurde auf ... deployed","color":16738816}]}' \
https://discordapp.com/api/webhooks/416531530211524608/7Y0qvzVl9LxNpB2FXQYV1N6Ps8dFvSQAV7mF4R0DqCFBUXD9ik2ltWA8ZVeABDyaKuDt