-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
99 lines (82 loc) · 2.33 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
88
89
90
91
92
93
94
95
96
97
98
99
export LC_CTYPE=en_US.UTF-8
.DEFAULT_GOAL := help
ifndef ROOT_DIR
ROOT_DIR := $(PWD)
endif
help:
@echo "Help:"
@echo
@echo " dependencies Install project dependencies."
@echo
@echo " docker Starts a local server."
@echo " docker-stop Stops the local server."
@echo
@echo " test Run all tests."
@echo " test-macos Test only macOS."
@echo " test-ios Test iPhone and iPad."
@echo " test-iphone Test only iPhone."
@echo " test-ipad Test only iPad."
@echo
#
# Functions
#
define dependencies
@bash script_install_dependencies.sh
endef
define runDockerAndFastlane
nohup caffeinate -ut 900 &
if $(MAKE) docker && asdf exec bundle exec fastlane $(1); then \
echo succeeded; \
else \
$(MAKE) docker-stop; \
exit 1; \
fi
endef
#
# Commands
#
dependencies:
$(call dependencies)
#
# Docker
#
docker:
rm -rf connect-server
git clone [email protected]:powerhome/connect-server.git --depth 1
@echo 'Disabling ldap...'
yq -i '.synapse.ldap.enabled = false' ./connect-server/deploy/environment/development/values.yaml
@echo 'Starting colima...'
colima start || (limactl stop colima -f && colima start)
@echo 'Starting docker...'
cd connect-server && docker-compose down --remove-orphans
cd connect-server && docker volume prune --force && docker-compose build && docker-compose up -d
@echo 'Dock server started.'
cp script_docker_setup.sh connect-server/script_docker_setup.sh
cd connect-server && ./script_docker_setup.sh
@echo 'Docker is running in the background, to stop it call: make docker-stop'
docker-stop:
cd connect-server && docker-compose down --remove-orphans
@echo 'Dock server stopped.'
colima stop || limactl stop colima -f
@echo 'Colima stopped.'
#
# Tests
#
test:
$(call runDockerAndFastlane,run_ui_tests_macos)
$(call runDockerAndFastlane,run_tests_iphone)
$(call runDockerAndFastlane,run_tests_ipad)
$(MAKE) docker-stop
test-macos:
$(call runDockerAndFastlane,run_ui_tests_macos)
$(MAKE) docker-stop
test-ios:
$(call runDockerAndFastlane,run_tests_ipad)
$(call runDockerAndFastlane,run_tests_iphone)
$(MAKE) docker-stop
test-iphone:
$(call runDockerAndFastlane,run_tests_iphone)
$(MAKE) docker-stop
test-ipad:
$(call runDockerAndFastlane,run_tests_ipad)
$(MAKE) docker-stop