Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
oess-review/Makefile
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
45 lines (38 sloc)
1.06 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Review settings | |
REPO = https://github.com/GlobalNOC/OESS.git | |
VERSION ?= master | |
SRC_DIR = src | |
# Use docker buildkit (it just makes things better) | |
export DOCKER_BUILDKIT=1 | |
# Build perlcritic image | |
.PHONY: build | |
build: | |
docker build . -t oess-review:latest | |
# Run perlcritic | |
.PHONY: perlcritic | |
PC_ARGS ?= --no-color | |
perlcritic: $(SRC_DIR) | |
cd $(SRC_DIR); git checkout $(VERSION) | |
docker run -it \ | |
-v $(PWD)/$(SRC_DIR):/src \ | |
--rm oess-review:latest perlcritic --statistics $(PC_ARGS) \ | |
src | |
# Rudimentary age of a file - when was the last-commit stamp for any specific file | |
.PHONY: code-age | |
code-age: $(SRC_DIR) | |
@cd $(SRC_DIR); git checkout $(VERSION) | |
@cd $(SRC_DIR); git ls-files | while read file; do \ | |
git --no-pager log -n 1 --date=iso \ | |
--pretty="%ad: %h: $$file" -- $$file; \ | |
done | |
# Open a shell inside perlcritic | |
.PHONY: shell | |
shell: $(SRC_DIR) | |
cd $(SRC_DIR); git checkout $(VERSION) | |
docker run -it \ | |
-v $(PWD)/$(SRC_DIR):/src \ | |
--rm oess-review:latest \ | |
bash | |
# Get a copy of the OESS source code | |
$(SRC_DIR): | |
git clone -b $(VERSION) $(REPO) $(SRC_DIR) |