diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d0b71a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build +dist diff --git a/Makefile b/Makefile index efe5ae6..0abcde9 100644 --- a/Makefile +++ b/Makefile @@ -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