-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
219 lines (184 loc) · 4.97 KB
/
Makefile
File metadata and controls
219 lines (184 loc) · 4.97 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
.NOTPARALLEL:
START_TIME := $(shell date "+%s")
DIVIDER = "--------------------------------------------------------------------------------"
SHELL = bin/gdk-shell
ASDF := $(shell command -v asdf 2> /dev/null)
RAKE := $(shell command -v rake 2> /dev/null)
BUNDLE := $(shell command -v bundle 2> /dev/null)
YARN := $(shell command -v yarn 2> /dev/null)
# Speed up Go module downloads
export GOPROXY ?= https://proxy.golang.org
# Silence Rollup when building GitLab Docs with nanoc
export ROLLUP_OPTIONS = --silent
NO_RAKE_REQUIRED := bootstrap bootstrap-packages lint
# Generate a Makefile from Ruby and include it
ifeq (,$(filter $(NO_RAKE_REQUIRED), $(MAKECMDGOALS)))
ifdef RAKE
include $(shell rake gdk-config.mk)
else
$(error "ERROR: Cannot find 'rake'. Please run 'make bootstrap'.")
endif
endif
export GDK_QUIET = $(gdk_quiet)
###############################################################################
# Include all support/makefiles/*.mk files here #
###############################################################################
include support/makefiles/*.mk
ifeq ($(platform),darwin)
OPENSSL_PREFIX := $(shell brew --prefix openssl@1.1)
OPENSSL := ${OPENSSL_PREFIX}/bin/openssl
else
OPENSSL := $(shell command -v openssl 2> /dev/null)
endif
support_bundle_install = $(gitlab_development_root)/support/bundle-install
# Borrowed from https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Makefile#n87
#
ifeq ($(gdk_debug),true)
Q =
QQ =
else
Q = @
QQ = > /dev/null
endif
QQerr = 2> /dev/null
ifeq ($(shallow_clone),true)
git_depth_param = --depth=1
endif
# This is used by `gdk install` and `gdk reconfigure`
#
.PHONY: all
all: preflight-checks \
gitlab-setup \
gdk-reconfigure-task \
gitlab-shell-setup \
gitlab-workhorse-setup \
gitlab-pages-setup \
gitlab-k8s-agent-setup \
support-setup \
gitaly-setup \
geo-config \
prom-setup \
object-storage-setup \
gitlab-elasticsearch-indexer-setup \
gitlab-metrics-exporter-setup \
grafana-setup \
gitlab-ui-setup \
gitlab-docs-setup \
gitlab-spamcheck-setup \
snowplow-micro-setup \
postgresql-sensible-defaults \
# This is used by `gdk install`
#
.PHONY: install
install: all show-installed-at start
# This is used by `gdk update`
#
# Pull gitlab directory first since dependencies are linked from there.
.PHONY: update
update: update-start \
asdf-update \
preflight-checks \
preflight-update-checks \
gitlab-git-pull \
ensure-databases-running \
unlock-dependency-installers \
gitlab-translations-unlock \
gitlab-shell-update \
gitlab-workhorse-update \
gitlab-pages-update \
gitlab-k8s-agent-update \
gitaly-update \
gitlab-update \
gitlab-elasticsearch-indexer-update \
gitlab-metrics-exporter-update \
object-storage-update \
jaeger-update \
grafana-update \
gitlab-ui-update \
gitlab-docs-update \
gitlab-spamcheck-update \
update-summarize
.PHONY: update-start
update-start:
@support/dev/makefile-timeit start
.PHONY: update-summarize
update-summarize:
@echo
@echo "${DIVIDER}"
@echo "Timings"
@echo "${DIVIDER}"
@echo
@support/dev/makefile-timeit summarize
@echo
@echo "${DIVIDER}"
@echo "Updated successfully as of $$(date +"%Y-%m-%d %T")"
@echo "${DIVIDER}"
# This is used by `gdk reconfigure`
#
.PHONY: reconfigure
reconfigure: unlock-dependency-installers \
touch-examples \
all \
show-reconfigured-at
.PHONY: clean
clean:
@true
self-update: unlock-dependency-installers
@echo
@echo "${DIVIDER}"
@echo "Running self-update on GDK"
@echo "${DIVIDER}"
$(Q)git stash ${QQ}
$(Q)support/self-update-git-worktree ${QQ}
.PHONY: touch-examples
touch-examples:
$(Q)touch \
gitlab-shell/config.yml.example \
gitlab/workhorse/config.toml.example \
$$(find support/templates -name "*.erb" -not -path "*/gitlab-pages-secret.erb") > /dev/null 2>&1 || true
unlock-dependency-installers:
$(Q)rm -f \
.gitlab-bundle \
.gitlab-shell-bundle \
.gitlab-yarn \
.gitlab-ui-yarn
gdk.yml:
$(Q)touch $@
.PHONY: rake
rake:
$(Q)command -v $@ ${QQ} || gem install $@
.PHONY: ensure-databases-running
ensure-databases-running: Procfile postgresql/data gitaly-update
@echo
@echo "${DIVIDER}"
@echo "Ensuring necessary data services are running"
@echo "${DIVIDER}"
$(Q)gdk start rails-migration-dependencies
.PHONY: diff-config
diff-config: touch-examples
$(Q)gdk $@
support-setup: Procfile redis gitaly-setup jaeger-setup postgresql openssh-setup nginx-setup registry-setup elasticsearch-setup runner-setup
.PHONY: start
start:
@echo
$(Q)gdk start
.PHONY: ask-to-restart
ask-to-restart:
@echo
$(Q)support/ask-to-restart
@echo
.PHONY: show-installed-at
show-installed-at:
@echo
@echo "> Installed as of $$(date +"%Y-%m-%d %T"). Took $$(($$(date +%s)-${START_TIME})) second(s)."
.PHONY: show-reconfigured-at
show-reconfigured-at:
@echo
@echo "> Reconfigured as of $$(date +"%Y-%m-%d %T"). Took $$(($$(date +%s)-${START_TIME})) second(s)."
.PHONY: gdk-reconfigure-task
gdk-reconfigure-task:
@echo
@echo "${DIVIDER}"
@echo "Ensuring GDK managed configuration files are up-to-date"
@echo "${DIVIDER}"
$(Q)rake reconfigure