Add signing to Makefile, ignore build and dist directories

This commit is contained in:
Raoul Snyman 2022-06-01 18:17:44 -07:00
parent e395edc60d
commit 773b852817
2 changed files with 22 additions and 8 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
build
dist

View File

@ -102,31 +102,26 @@ distclean: clean
rm -rf js/vendor
rm -rf js/node_modules
# Builds the source and appstore package
.PHONY: dist
dist:
make source
make appstore
# Builds the source package
.PHONY: source
source:
rm -rf $(source_build_directory)
mkdir -p $(source_build_directory)
tar cvzf $(source_package_name).tar.gz ../$(app_name) \
tar -czf $(source_package_name).tar.gz \
--exclude-vcs \
--exclude="../$(app_name)/build" \
--exclude="../$(app_name)/js/node_modules" \
--exclude="../$(app_name)/node_modules" \
--exclude="../$(app_name)/*.log" \
--exclude="../$(app_name)/js/*.log" \
../$(app_name)
# Builds the source package for the app store, ignores php and js tests
.PHONY: appstore
appstore:
rm -rf $(appstore_build_directory)
mkdir -p $(appstore_build_directory)
tar cvzf $(appstore_package_name).tar.gz ../$(app_name) \
tar -czf $(appstore_package_name).tar.gz \
--exclude-vcs \
--exclude="../$(app_name)/build" \
--exclude="../$(app_name)/tests" \
@ -148,8 +143,25 @@ appstore:
--exclude="../$(app_name)/protractor\.*" \
--exclude="../$(app_name)/.*" \
--exclude="../$(app_name)/js/.*" \
../$(app_name)
.PHONY: test
test: composer
$(CURDIR)/vendor/phpunit/phpunit/phpunit -c phpunit.xml
$(CURDIR)/vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml
.PHONY: sign
sign: appstore
mkdir -p "$(CURDIR)/dist"
cd "$(CURDIR)/dist" && tar -xf $(appstore_package_name).tar.gz
-docker stop externalpassword-sign
docker run --rm -d --name externalpassword-sign \
--volume "$(CURDIR)/dist/externalpassword:/externalpassword" \
--volume "${HOME}/.nextcloud/certificates:/certificates" nextcloud
sleep 5s
docker exec -ti externalpassword-sign php occ integrity:sign-app \
--path /externalpassword \
--privateKey=/certificates/externalpassword.key \
--certificate=/certificates/externalpassword.crt
docker stop externalpassword-sign
cd "$(CURDIR)/dist" && tar -czf externalpassword.tar.gz externalpassword