1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00
Files
sops/Makefile

101 lines
3.8 KiB
Makefile
Raw Normal View History

2016-08-24 12:37:18 -07:00
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
PROJECT := go.mozilla.org/sops
GO := GO15VENDOREXPERIMENT=1 go
GOLINT := golint
2016-11-13 22:20:13 +01:00
all: test vet generate install functional-tests
2016-08-24 12:37:18 -07:00
install:
2016-09-19 11:25:29 -07:00
$(GO) install go.mozilla.org/sops/cmd/sops
2016-08-24 12:37:18 -07:00
tag: all
git tag -s $(TAGVER) -a -m "$(TAGMSG)"
lint:
$(GOLINT) $(PROJECT)
vendor:
govend -u
2016-08-24 12:37:18 -07:00
vet:
$(GO) vet $(PROJECT)
test:
2016-08-25 12:21:10 -07:00
touch coverage.txt
2016-10-27 13:47:36 -04:00
$(GO) test -coverprofile=coverage_tmp.txt -covermode=atomic $(PROJECT) && cat coverage_tmp.txt >> coverage.txt
$(GO) test $(PROJECT)/aes -coverprofile=coverage_tmp.txt -covermode=atomic && cat coverage_tmp.txt >> coverage.txt
2017-09-06 17:36:39 -07:00
$(GO) test $(PROJECT)/cmd/sops -coverprofile=coverage_tmp.txt -covermode=atomic && cat coverage_tmp.txt >> coverage.txt
$(GO) test $(PROJECT)/decrypt -coverprofile=coverage_tmp.txt -covermode=atomic && cat coverage_tmp.txt >> coverage.txt
2017-09-12 09:59:23 -07:00
$(GO) test $(PROJECT)/config -coverprofile=coverage_tmp.txt -covermode=atomic && cat coverage_tmp.txt >> coverage.txt
$(GO) test $(PROJECT)/stores/yaml -coverprofile=coverage_tmp.txt -covermode=atomic && cat coverage_tmp.txt >> coverage.txt
$(GO) test $(PROJECT)/stores/json -coverprofile=coverage_tmp.txt -covermode=atomic && cat coverage_tmp.txt >> coverage.txt
2016-08-25 12:21:10 -07:00
gpg --import pgp/sops_functional_tests_key.asc 2>&1 1>/dev/null || exit 0
2016-10-27 13:47:36 -04:00
$(GO) test $(PROJECT)/pgp -coverprofile=coverage_tmp.txt -covermode=atomic && cat coverage_tmp.txt >> coverage.txt
$(GO) test $(PROJECT)/kms -coverprofile=coverage_tmp.txt -covermode=atomic && cat coverage_tmp.txt >> coverage.txt
2016-08-24 12:37:18 -07:00
showcoverage: test
$(GO) tool cover -html=coverage.out
generate:
$(GO) generate
2016-11-13 22:20:13 +01:00
functional-tests:
$(GO) build -o functional-tests/sops go.mozilla.org/sops/cmd/sops
cd functional-tests && cargo test
deb-pkg: install
rm -rf tmppkg
mkdir -p tmppkg/usr/local/bin
cp $$GOPATH/bin/sops tmppkg/usr/local/bin/
fpm -C tmppkg -n sops --license MPL2.0 --vendor mozilla \
--description "Sops is an editor of encrypted files that supports YAML, JSON and BINARY formats and encrypts with AWS KMS and PGP." \
-m "Julien Vehent <jvehent+sops@mozilla.com>" \
--url https://go.mozilla.org/sops \
--architecture x86_64 \
-v "$$(git describe --abbrev=0 --tags)" \
-s dir -t deb .
rpm-pkg: install
rm -rf tmppkg
mkdir -p tmppkg/usr/local/bin
cp $$GOPATH/bin/sops tmppkg/usr/local/bin/
fpm -C tmppkg -n sops --license MPL2.0 --vendor mozilla \
--description "Sops is an editor of encrypted files that supports YAML, JSON and BINARY formats and encrypts with AWS KMS and PGP." \
-m "Julien Vehent <jvehent+sops@mozilla.com>" \
--url https://go.mozilla.org/sops \
--architecture x86_64 \
-v "$$(git describe --abbrev=0 --tags)" \
-s dir -t rpm .
dmg-pkg: install
ifneq ($(OS),darwin)
echo 'you must be on MacOS and set OS=darwin on the make command line to build an OSX package'
else
rm -rf tmppkg
mkdir -p tmppkg/usr/local/bin
cp $$GOPATH/bin/sops tmppkg/usr/local/bin/
fpm -C tmppkg -n sops --license MPL2.0 --vendor mozilla \
--description "Sops is an editor of encrypted files that supports YAML, JSON and BINARY formats and encrypts with AWS KMS and PGP." \
-m "Julien Vehent <jvehent+sops@mozilla.com>" \
--url https://go.mozilla.org/sops \
--architecture x86_64 \
-v "$$(git describe --abbrev=0 --tags)" \
-s dir -t osxpkg \
--osxpkg-identifier-prefix org.mozilla.sops \
-p tmppkg/sops-$$(git describe --abbrev=0 --tags).pkg .
hdiutil makehybrid -hfs -hfs-volume-name "Mozilla Sops" \
-o tmppkg/sops-$$(git describe --abbrev=0 --tags).dmg tmpdmg
endif
2016-11-30 11:40:38 -05:00
download-index:
bash make_download_page.sh
2017-02-22 12:26:02 +01:00
mock:
go get github.com/vektra/mockery/.../
mockery -dir vendor/github.com/aws/aws-sdk-go/service/kms/kmsiface/ -name KMSAPI -output kms/mocks
.PHONY: all test generate clean vendor functional-tests mock