mirror of
https://github.com/sobolevn/git-secret
synced 2024-10-31 21:20:29 +00:00
5c25233b89
There are a lot of changes, multiple things were refactored: tests, some commands, building and meta. Several critical bugs fixed. Changes: 1. Fixed #74, when `_user_required` was not working after reimporting keys 2. Closes #73, now it is possible to provide multiple emails to the `killperson` command 3. Closes #72, now it is possible to provide multiple emails to the `tell` command 4. Closes #71, now every doc in this project refer to `git-secret.io` instead of old `gh-pages` website 5. Closes #70, now installation section is removed from main `man` file 6. Closes #69, now "See also" section in the `man`s are clickable 7. Closes #61, added "Manual" section to the manuals 8. Refs #38, added `centos` Dockerfile, but `ci` testing is still failing 9. Refs #52, tests are refactored. Added `clean` command tests, removed a lot of hardcoded things, moved tests execution from `./temp` folder to `/tmp`, added a lot of new check in old tests, and some new test cases 10. Refactored `hide` and `clean` commands to be shorter 11. `shellcheck` is now supported with `make lint` Additional features are not comming to 0.2.2 after this commit.
147 lines
3.2 KiB
Makefile
147 lines
3.2 KiB
Makefile
SHELL:=/usr/bin/env bash
|
|
PREFIX?="/usr"
|
|
|
|
#
|
|
# Building:
|
|
#
|
|
|
|
git-secret: src/version.sh src/_utils/* src/commands/* src/main.sh
|
|
@cat $^ > "$@"; \
|
|
chmod +x git-secret; sync
|
|
|
|
.PHONY: all
|
|
all: build
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
@rm -f git-secret
|
|
|
|
.PHONY: build
|
|
build: git-secret
|
|
|
|
.PHONY: install
|
|
install:
|
|
@chmod +x "./utils/install.sh"; sync; \
|
|
"./utils/install.sh" "${PREFIX}"
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
@chmod +x "./utils/uninstall.sh"; sync; \
|
|
"./utils/uninstall.sh" "${PREFIX}"
|
|
|
|
#
|
|
# Testing:
|
|
#
|
|
|
|
.PHONY: install-test
|
|
install-test:
|
|
@if [ ! -d "vendor/bats" ]; then \
|
|
git clone https://github.com/sstephenson/bats.git vendor/bats; fi
|
|
|
|
.PHONY: test
|
|
test: install-test clean build
|
|
@chmod +x "./utils/tests.sh"; sync; \
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
export PATH="${PWD}/vendor/bats/bin:${PWD}:${PATH}"; \
|
|
"./utils/tests.sh"
|
|
|
|
#
|
|
# Manuals:
|
|
#
|
|
|
|
.PHONY: install-ronn
|
|
install-ronn:
|
|
@if [ ! `gem list ronn -i` == "true" ]; then gem install ronn; fi
|
|
|
|
.PHONY: clean-man
|
|
clean-man:
|
|
@find "man/" -type f ! -name "*.ronn" -delete
|
|
|
|
.PHONY: build-man
|
|
build-man: install-ronn clean-man
|
|
@ronn --roff --organization="sobolevn" --manual="git-secret" man/*/*.ronn
|
|
|
|
.PHONY: build-gh-pages
|
|
build-gh-pages:
|
|
@chmod +x "./utils/gh-branch.sh"; sync; \
|
|
"./utils/gh-branch.sh"
|
|
|
|
#
|
|
# Development:
|
|
#
|
|
|
|
.PHONY: install-hooks
|
|
install-hooks:
|
|
@ln -fs "${PWD}/utils/hooks/pre-commit.sh" "${PWD}/.git/hooks/pre-commit"; \
|
|
chmod +x "${PWD}/.git/hooks/pre-commit"; sync; \
|
|
ln -fs "${PWD}/utils/hooks/post-commit.sh" "${PWD}/.git/hooks/post-commit"; \
|
|
chmod +x "${PWD}/.git/hooks/post-commit"; sync
|
|
|
|
.PHONY: develop
|
|
develop: clean build install-hooks
|
|
|
|
.PHONY: lint
|
|
lint:
|
|
@find src utils -type f -name '*.sh' -print0 | xargs -0 -I {} shellcheck {}
|
|
|
|
#
|
|
# Packaging:
|
|
#
|
|
|
|
.PHONY: install-fpm
|
|
install-fpm:
|
|
@if [ ! `gem list fpm -i` == "true" ]; then gem install fpm; fi
|
|
|
|
# .deb:
|
|
|
|
.PHONY: build-deb
|
|
build-deb: clean build install-fpm
|
|
@chmod +x "./utils/build-utils.sh"; sync; \
|
|
chmod +x "./utils/deb/deb-build.sh"; sync; \
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
"./utils/deb/deb-build.sh"
|
|
|
|
.PHONY: test-deb-ci
|
|
test-deb-ci: install-test build-deb
|
|
@chmod +x "./utils/deb/deb-ci.sh"; sync; \
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
export PATH="${PWD}/vendor/bats/bin:${PATH}"; \
|
|
"./utils/deb/deb-ci.sh"
|
|
|
|
.PHONY: deploy-deb
|
|
deploy-deb: build-deb
|
|
@chmod +x "./utils/deb/deb-deploy.sh"; sync; \
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
"./utils/deb/deb-deploy.sh"
|
|
|
|
# .rpm:
|
|
|
|
.PHONY: build-rpm
|
|
build-rpm: clean build install-fpm
|
|
@chmod +x "./utils/build-utils.sh"; sync; \
|
|
chmod +x "./utils/rpm/rpm-build.sh"; sync; \
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
"./utils/rpm/rpm-build.sh"
|
|
|
|
.PHONY: test-rpm-ci
|
|
test-rpm-ci: install-test build-rpm
|
|
@chmod +x "./utils/rpm/rpm-ci.sh"; sync; \
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
export PATH="${PWD}/vendor/bats/bin:${PATH}"; \
|
|
"./utils/rpm/rpm-ci.sh"
|
|
|
|
.PHONY: deploy-rpm
|
|
deploy-rpm: build-rpm
|
|
@chmod +x "./utils/rpm/rpm-deploy.sh"; sync; \
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
"./utils/rpm/rpm-deploy.sh"
|
|
|
|
# make:
|
|
|
|
.PHONY: test-make-ci
|
|
test-make-ci: clean install-test
|
|
@chmod +x "./utils/make/make-ci.sh"; sync; \
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
export PATH="${PWD}/vendor/bats/bin:${PATH}"; \
|
|
"./utils/make/make-ci.sh"
|