-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
83 lines (67 loc) · 2.14 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
DOWNLOADER_IMAGE_NAME=hexlet/gitlab-downloader
DOWNLOADER_HOME=/home/tirion
SSH_KEYS_PATH?=$(HOME)/.ssh
UID := $(shell id -u)
GID := $(shell id -g)
HEXLETHQ=hexlethq
LOCALE ?=
REGISTRY := cr.yandex/crpa5i79t7oiqnj0ap8g
setup: create-config pull build-downloader prepare-dirs
make -C import-documentation all
npm ci
prepare-dirs:
mkdir -p exercises
mkdir -p courses
mkdir -p projects
mkdir -p programs
mkdir -p boilerplates
pull:
docker pull $(REGISTRY)/hexlet-python
docker pull $(REGISTRY)/hexlet-java
docker pull $(REGISTRY)/hexlet-javascript
docker pull $(REGISTRY)/hexlet-php
docker pull ghcr.io/hexlet/languagetool-cli
create-config:
cp -n .env.example .env || echo 'already exists'
build-downloader: create-config
docker build -t $(DOWNLOADER_IMAGE_NAME):latest \
--build-arg UID=$(UID) \
--build-arg GID=$(GID) \
./repo-downloader
copy-from-cb:
make -C code-basics-synchronizer
downloader-run:
docker run -it --rm \
--env-file ./.env \
-v $(SSH_KEYS_PATH):/home/tirion/.ssh \
-v $(CURDIR):/data/hexlethq \
$(DOWNLOADER_IMAGE_NAME) \
clone $(HEXLETHQ)/$(FILTER)$(if $(LOCALE),/$(LOCALE))
clone: clone-courses clone-exercises clone-projects clone-boilerplates
clone-courses:
make downloader-run FILTER=courses
clone-exercises:
make downloader-run FILTER=exercises
clone-projects:
make downloader-run FILTER=projects
clone-boilerplates:
make downloader-run FILTER=boilerplates
update-hexlet-linter:
docker pull $(REGISTRY)/common-${L}
docker volume rm -f hexlet-linter-${L}
docker run --rm -v hexlet-linter-${L}:/linter $(REGISTRY)/common-${L} echo > /dev/null
update-hexlet-linters:
make update-hexlet-linter L=eslint
make update-hexlet-linter L=python-flake8
make update-hexlet-linter L=phpcs
make update-hexlet-linter L=checkstyle
make update-hexlet-linter L=sqlint
make update-hexlet-linter L=rubocop
make update-hexlet-linter L=multi-language
create-localizer-config:
cp -n content-localizer/.env.template content-localizer/.env || echo 'already exists'
build-localizer: create-localizer-config
docker build -t hexlet/content-localizer \
--build-arg UID=$(UID) \
--build-arg GID=$(GID) \
./content-localizer