AdGuardHome/Makefile
Ainar Garipov 1c87dc577d Pull request: all: add bamboo specs
Merge in DNS/adguard-home from add-specs to master

Squashed commit of the following:

commit 011f9ae643e84b9bcd407cba5d86c586a73f7366
Merge: 856364fb 80ed8be1
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Apr 7 20:20:32 2021 +0300

    Merge branch 'master' into add-specs

commit 856364fb55901f977b6e25fa3cd90be5f680d3ad
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Apr 7 14:35:00 2021 +0300

    all: fix awk invocation

commit 202a04f5dd0860c094c887d7fdb71e6424a6d0ce
Merge: cdd95cfa 00a61fde
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Apr 6 20:49:05 2021 +0300

    Merge branch 'master' into add-specs

commit cdd95cfa4e6be74acd4d15a2908504e9e27f29d8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Apr 6 18:03:55 2021 +0300

    all: fix specs

commit fe2a3017f5c88d429ca6f962dee293338d55919f
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Apr 6 17:30:45 2021 +0300

    all: use the correct gpg key

commit a28eff00f7a98a078e34c2b16e887c05364b6087
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Apr 6 17:14:28 2021 +0300

    all: imp Makefile, specs

commit 6faa3c0687387e4fd60433d326a99da01dd21b02
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Apr 6 16:50:41 2021 +0300

    all: add bamboo specs
2021-04-08 13:55:12 +03:00

94 lines
2.7 KiB
Makefile

# Keep the Makefile POSIX-compliant. We currently allow hyphens in
# target names, but that may change in the future.
#
# See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
.POSIX:
CHANNEL = development
CLIENT_BETA_DIR = client2
CLIENT_DIR = client
COMMIT = $$(git rev-parse --short HEAD)
DIST_DIR = dist
GO = go
GOPROXY = https://goproxy.cn|https://proxy.golang.org|direct
GPG_KEY = devteam@adguard.com
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
NPM_INSTALL_FLAGS = $(NPM_FLAGS) --quiet --no-progress --ignore-engines\
--ignore-optional --ignore-platform --ignore-scripts
RACE = 0
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
YARN_INSTALL_FLAGS = $(YARN_FLAGS) --network-timeout 120000 --silent\
--ignore-engines --ignore-optional --ignore-platform\
--ignore-scripts
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY='$(GPG_KEY)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
RACE='$(RACE)'\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
lint: js-lint go-lint
test: js-test go-test
# Here and below, keep $(SHELL) in quotes, because on Windows this will
# expand to something like "C:/Program Files/Git/usr/bin/sh.exe".
build-docker: ; $(ENV) "$(SHELL)" ./scripts/make/build-docker.sh
build-release: deps js-build
$(ENV) "$(SHELL)" ./scripts/make/build-release.sh
clean: ; $(ENV) "$(SHELL)" ./scripts/make/clean.sh
init: ; git config core.hooksPath ./scripts/hooks
js-build:
$(NPM) $(NPM_FLAGS) run build-prod
$(YARN) $(YARN_FLAGS) build
js-deps:
$(NPM) $(NPM_INSTALL_FLAGS) ci
$(YARN) $(YARN_INSTALL_FLAGS) install
# TODO(a.garipov): Remove the legacy client tasks support once the new
# client is done and the old one is removed.
js-lint: ; $(NPM) $(NPM_FLAGS) run lint
js-test: ; $(NPM) $(NPM_FLAGS) run test
js-beta-lint: ; $(YARN) $(YARN_FLAGS) lint
js-beta-test: ; # TODO(v.abdulmyanov): Add tests for the new client.
go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh
# TODO(a.garipov): Think about making RACE='1' the default for all
# targets.
go-test: ; $(ENV) RACE='1' "$(SHELL)" ./scripts/make/go-test.sh
go-check: go-tools go-lint go-test
openapi-lint: ; cd ./openapi/ && $(YARN) test
openapi-show: ; cd ./openapi/ && $(YARN) start