2016-03-12 21:35:05 +00:00
|
|
|
SHELL:=/usr/bin/env bash
|
2016-03-13 09:14:28 +00:00
|
|
|
PREFIX?="/usr"
|
2019-03-21 20:10:13 +00:00
|
|
|
DESTDIR?=
|
2016-03-12 21:35:05 +00:00
|
|
|
|
2016-03-12 19:21:04 +00:00
|
|
|
#
|
|
|
|
# Building:
|
|
|
|
#
|
|
|
|
|
2018-10-11 01:21:58 +00:00
|
|
|
git-secret: src/version.sh src/_utils/*.sh src/commands/*.sh src/main.sh
|
2019-03-17 20:54:35 +00:00
|
|
|
cat $^ > "$@"; \
|
2016-06-16 19:34:25 +00:00
|
|
|
chmod +x git-secret; sync
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: all
|
2016-02-21 13:26:17 +00:00
|
|
|
all: build
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: clean
|
2016-02-21 13:26:17 +00:00
|
|
|
clean:
|
2019-03-17 20:54:35 +00:00
|
|
|
rm -f git-secret
|
2016-02-21 13:26:17 +00:00
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: build
|
2016-02-21 13:26:17 +00:00
|
|
|
build: git-secret
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/install.sh"; sync; \
|
2019-03-21 20:10:13 +00:00
|
|
|
"./utils/install.sh" "${DESTDIR}${PREFIX}"
|
2016-05-14 11:03:33 +00:00
|
|
|
|
2016-06-28 21:00:15 +00:00
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/uninstall.sh"; sync; \
|
2019-03-21 20:10:13 +00:00
|
|
|
"./utils/uninstall.sh" "${DESTDIR}${PREFIX}"
|
2016-06-28 21:00:15 +00:00
|
|
|
|
2016-03-12 19:21:04 +00:00
|
|
|
#
|
|
|
|
# Testing:
|
|
|
|
#
|
|
|
|
|
2019-03-09 23:49:45 +00:00
|
|
|
# The $(shell echo $${PWD}) construct is to access *nix paths under windows
|
|
|
|
# Under git for windows '$PATH' is set to windows paths, e.g. C:\Something
|
|
|
|
# Using a sub-shell we get the raw *nix paths, e.g. /c/Something
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: test
|
2019-03-04 23:52:53 +00:00
|
|
|
test: clean build
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/tests.sh"; sync; \
|
2019-03-09 23:49:45 +00:00
|
|
|
export SECRET_PROJECT_ROOT="$(shell echo $${PWD})"; \
|
|
|
|
export PATH="$(shell echo $${PWD})/vendor/bats-core/bin:$(shell echo $${PWD}):$(shell echo $${PATH})"; \
|
2016-06-16 19:34:25 +00:00
|
|
|
"./utils/tests.sh"
|
2016-02-21 13:26:17 +00:00
|
|
|
|
2016-03-12 19:21:04 +00:00
|
|
|
#
|
|
|
|
# Manuals:
|
|
|
|
#
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: install-ronn
|
2016-03-12 19:21:04 +00:00
|
|
|
install-ronn:
|
2019-03-17 20:54:35 +00:00
|
|
|
if [ ! `gem list ronn -i` == "true" ]; then gem install ronn; fi
|
2016-02-21 13:26:17 +00:00
|
|
|
|
Version 0.2.2 pre-release
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.
2017-02-26 13:38:46 +00:00
|
|
|
.PHONY: clean-man
|
|
|
|
clean-man:
|
2019-03-17 20:54:35 +00:00
|
|
|
find "man/" -type f ! -name "*.ronn" -delete
|
Version 0.2.2 pre-release
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.
2017-02-26 13:38:46 +00:00
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: build-man
|
2019-09-20 17:05:06 +00:00
|
|
|
build-man: install-ronn clean-man git-secret
|
|
|
|
touch man/*/*.ronn
|
|
|
|
export GITSECRET_VERSION=`./git-secret --version` && ronn --roff --organization="sobolevn" --manual="git-secret $${GITSECRET_VERSION}" man/*/*.ronn
|
2016-02-21 13:26:17 +00:00
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: build-gh-pages
|
2016-02-23 21:25:39 +00:00
|
|
|
build-gh-pages:
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/gh-branch.sh"; sync; \
|
2016-06-16 19:34:25 +00:00
|
|
|
"./utils/gh-branch.sh"
|
2016-02-23 21:25:39 +00:00
|
|
|
|
2016-03-12 19:21:04 +00:00
|
|
|
#
|
|
|
|
# Development:
|
|
|
|
#
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: install-hooks
|
2016-02-21 13:26:17 +00:00
|
|
|
install-hooks:
|
2019-03-17 20:54:35 +00:00
|
|
|
ln -fs "${PWD}/utils/hooks/pre-commit.sh" "${PWD}/.git/hooks/pre-commit"; \
|
2016-06-16 19:34:25 +00:00
|
|
|
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
|
2016-02-21 13:26:17 +00:00
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: develop
|
2016-02-21 13:26:17 +00:00
|
|
|
develop: clean build install-hooks
|
2016-03-12 19:21:04 +00:00
|
|
|
|
Version 0.2.2 pre-release
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.
2017-02-26 13:38:46 +00:00
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
2019-03-17 20:54:35 +00:00
|
|
|
find src utils -type f -name '*.sh' -print0 | xargs -0 -I {} shellcheck {}
|
|
|
|
find tests -type f -name '*.bats' -o -name '*.bash' -print0 | xargs -0 -I {} shellcheck {}
|
Version 0.2.2 pre-release
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.
2017-02-26 13:38:46 +00:00
|
|
|
|
2016-03-12 19:21:04 +00:00
|
|
|
#
|
|
|
|
# Packaging:
|
|
|
|
#
|
|
|
|
|
2016-05-14 11:03:33 +00:00
|
|
|
.PHONY: install-fpm
|
2016-03-12 19:21:04 +00:00
|
|
|
install-fpm:
|
2019-03-17 20:54:35 +00:00
|
|
|
if [ ! `gem list fpm -i` == "true" ]; then gem install fpm; fi
|
2016-03-12 19:21:04 +00:00
|
|
|
|
2017-11-27 21:46:27 +00:00
|
|
|
# .apk:
|
2017-11-10 18:31:22 +00:00
|
|
|
|
|
|
|
.PHONY: build-apk
|
|
|
|
build-apk: clean build install-fpm
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/build-utils.sh"; sync; \
|
2017-11-10 18:31:22 +00:00
|
|
|
chmod +x "./utils/apk/apk-build.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/apk/apk-build.sh"
|
|
|
|
|
|
|
|
.PHONY: test-apk-ci
|
2019-03-04 23:52:53 +00:00
|
|
|
test-apk-ci: build-apk
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/apk/apk-ci.sh"; sync; \
|
2017-11-10 18:31:22 +00:00
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
2018-06-20 15:11:04 +00:00
|
|
|
export PATH="${PWD}/vendor/bats-core/bin:${PATH}"; \
|
2017-11-10 18:31:22 +00:00
|
|
|
"./utils/apk/apk-ci.sh"
|
|
|
|
|
|
|
|
.PHONY: deploy-apk
|
|
|
|
deploy-apk: build-apk
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/apk/apk-deploy.sh"; sync; \
|
2017-11-10 18:31:22 +00:00
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/apk/apk-deploy.sh"
|
|
|
|
|
2016-06-16 19:34:25 +00:00
|
|
|
# .deb:
|
2016-03-12 19:21:04 +00:00
|
|
|
|
2016-06-16 19:34:25 +00:00
|
|
|
.PHONY: build-deb
|
|
|
|
build-deb: clean build install-fpm
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/build-utils.sh"; sync; \
|
2016-06-16 19:34:25 +00:00
|
|
|
chmod +x "./utils/deb/deb-build.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/deb/deb-build.sh"
|
|
|
|
|
|
|
|
.PHONY: test-deb-ci
|
2019-03-04 23:52:53 +00:00
|
|
|
test-deb-ci: build-deb
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/deb/deb-ci.sh"; sync; \
|
2016-06-16 19:34:25 +00:00
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
2018-06-20 15:11:04 +00:00
|
|
|
export PATH="${PWD}/vendor/bats-core/bin:${PATH}"; \
|
2016-06-16 19:34:25 +00:00
|
|
|
"./utils/deb/deb-ci.sh"
|
|
|
|
|
|
|
|
.PHONY: deploy-deb
|
|
|
|
deploy-deb: build-deb
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/deb/deb-deploy.sh"; sync; \
|
2016-06-16 19:34:25 +00:00
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/deb/deb-deploy.sh"
|
|
|
|
|
|
|
|
# .rpm:
|
|
|
|
|
|
|
|
.PHONY: build-rpm
|
|
|
|
build-rpm: clean build install-fpm
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/build-utils.sh"; sync; \
|
2016-06-16 19:34:25 +00:00
|
|
|
chmod +x "./utils/rpm/rpm-build.sh"; sync; \
|
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/rpm/rpm-build.sh"
|
|
|
|
|
|
|
|
.PHONY: test-rpm-ci
|
2019-03-04 23:52:53 +00:00
|
|
|
test-rpm-ci: build-rpm
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/rpm/rpm-ci.sh"; sync; \
|
2016-06-16 19:34:25 +00:00
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
2018-06-20 15:11:04 +00:00
|
|
|
export PATH="${PWD}/vendor/bats-core/bin:${PATH}"; \
|
2016-06-16 19:34:25 +00:00
|
|
|
"./utils/rpm/rpm-ci.sh"
|
|
|
|
|
|
|
|
.PHONY: deploy-rpm
|
|
|
|
deploy-rpm: build-rpm
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/rpm/rpm-deploy.sh"; sync; \
|
2016-06-16 19:34:25 +00:00
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
|
|
|
"./utils/rpm/rpm-deploy.sh"
|
2016-07-02 09:32:07 +00:00
|
|
|
|
|
|
|
# make:
|
|
|
|
|
|
|
|
.PHONY: test-make-ci
|
2019-03-04 23:52:53 +00:00
|
|
|
test-make-ci: clean
|
2019-03-17 20:54:35 +00:00
|
|
|
chmod +x "./utils/make/make-ci.sh"; sync; \
|
2016-07-02 09:32:07 +00:00
|
|
|
export SECRET_PROJECT_ROOT="${PWD}"; \
|
2018-06-20 15:11:04 +00:00
|
|
|
export PATH="${PWD}/vendor/bats-core/bin:${PATH}"; \
|
2016-07-02 09:32:07 +00:00
|
|
|
"./utils/make/make-ci.sh"
|