From cc433f50f0363dbf20a5a25204745fc9145ac666 Mon Sep 17 00:00:00 2001 From: yazart Date: Mon, 25 May 2026 14:43:31 +0300 Subject: [PATCH] feat: init project --- .gitignore | 0 .gitmodules | 3 ++ Dockerfile | 0 Makefile | 93 +++++++++++++++++++++++++++++++++++++++++++++++++ input/.gitkeep | 0 meta/.gitkeep | 0 report/.gitkeep | 0 status/.gitkeep | 0 8 files changed, 96 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 input/.gitkeep create mode 100644 meta/.gitkeep create mode 100644 report/.gitkeep create mode 100644 status/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4b9f887 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "runtime_check"] + path = runtime_check + url = ssh://git@git.taskalo.ru:722/default/runtime_check.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..57176c5 --- /dev/null +++ b/Makefile @@ -0,0 +1,93 @@ +ifneq (, $(shell ls ../../vision-guard-share/ | grep headers.mk)) +include ../../vision-guard-share/headers.mk +export MAIN_TRUNC=yes +GET_VERSION_DEP=get_version +else +export MAIN_TRUNC=no +LOCAL_BUILD=1 +FINAL_VERSION=latest +GET_VERSION_DEP= +endif + +.PHONY: test test_coverage test_ci lint lint_ci dep fmt build build_scanfeeder build_ci apply_git_hooks postclone precommit clean build_docker_image docker_image_ci help get_version get_build_date + +export TEST_BINARY_NAME=vsix_runtime_check +export NAME_REPO="default/vsix_runtime_check" + +test: check-tests-docker-image build_docker_image get_version ## Run unittests + @docker run --rm -it -v ${TESTS_PATH}:/tests:ro -v ${TEST_BINARY_PATH}:/tests_binary -e DST_USER_ID=$(shell id -u) -e DST_GROUP_ID=$(shell id -g) -e TEST_BINARY_NAME=${TEST_BINARY_NAME} --name vsix_runtime_check-test plugin-tests > /dev/null + @VSIX_RUNTIME_CHECK_VER=${FINAL_VERSION} ${TEST_BINARY_PATH}/${TEST_BINARY_NAME} -test.v + +test_coverage: ## Run unittests with calculating code coverage + @echo "TODO" + +test_ci: ## Run unittests as CI + @docker run --rm -it -v ${TESTS_PATH}:/tests:ro -v ${TEST_BINARY_PATH}:/tests_binary -e DST_USER_ID=$(shell id -u) -e DST_GROUP_ID=$(shell id -g) -e TEST_BINARY_NAME=${TEST_BINARY_NAME} --name vsix_runtime_check-test plugin-tests > /dev/null + @VSIX_RUNTIME_CHECK_VER=${VSIX_RUNTIME_CHECK_VER} ${TEST_BINARY_PATH}/${TEST_BINARY_NAME} -test.v + +lint: ## Lint the files +ifeq (yes,${MAIN_TRUNC}) + @(cd tests && $(LINTER) short) +else + @echo "TODO" +endif + +lint_ci: ## Lint the files as CI +ifeq (yes,${MAIN_TRUNC}) + @(cd tests && $(LINTER) full) +else + @echo "TODO" +endif + +dep: ## Get the dependencies + @echo "TODO" + +fmt: ## Format source code +ifeq (yes,${MAIN_TRUNC}) + @$(FORMATTER) +else + @echo "TODO" +endif + +build: ## Build the binary file from src + @echo "TODO" + +build_scanfeeder: ## Build the scanfeeder binary file from src and copy it to tools folder +ifeq (yes,${MAIN_TRUNC}) + $(MAKE) -C $(ROOT_DIR)/tools/scanfeeder build + @cp $(ROOT_DIR)/tools/scanfeeder/scanfeeder ./scanfeeder +else +ifeq (yes,$(shell test -f scanfeeder && echo -n yes)) + @echo "Using existing scanfeeder" +else + @echo "#!/bin/bash" > ./scanfeeder + @chmod +x ./scanfeeder +endif +endif + +build_ci: ## Build the binary file from src as CI + @echo "TODO" + +apply_git_hooks: ## copy git hooks to .git folder + @echo "TODO" + +postclone: apply_git_hooks dep ## Post clone actions + +clean: ## Remove previous build + @echo "TODO" + +build_docker_image: build_scanfeeder $(GET_VERSION_DEP) get_build_date ## Build local docker image + @docker build --build-arg DST_USER_ID=$(shell id -u) --build-arg DST_GROUP_ID=$(shell id -g) \ + --build-arg LOCAL_BUILD=$(LOCAL_BUILD) --build-arg RELEASE_VERSION="$(FINAL_VERSION)" \ + --build-arg BUILD_DATE="$(BUILD_DATE)" -t vsix_runtime_check:$(FINAL_VERSION) . + +docker_image_ci: build_scanfeeder ## Build and push docker image from ci + @docker build -t vsix_runtime_check . + @echo "TODO push docker images" + +git-submodules-update: + @git submodule sync --recursive + @git submodule update --init --remote --recursive + +help: ## Display this help screen + @grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/input/.gitkeep b/input/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/meta/.gitkeep b/meta/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/report/.gitkeep b/report/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/status/.gitkeep b/status/.gitkeep new file mode 100644 index 0000000..e69de29