summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2016-04-21 00:20:00 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2016-04-21 00:20:00 +0200
commitf761c36ebc3db6436870fff6f1498a07657445db (patch)
tree79f7dbf442a65406b2709f17b3f0edd89045c3e7 /Makefile
parent4cde44093f73d53ff8fa925e0de528739743f1e2 (diff)
add code signing to makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 21 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7cb750e60..56e60437c 100644
--- a/Makefile
+++ b/Makefile
@@ -50,6 +50,16 @@ appstore_package_name=$(appstore_artifact_directory)/$(app_name)
npm=$(shell which npm 2> /dev/null)
composer=$(shell which composer 2> /dev/null)
+# code signing
+# assumes the following:
+# * the app is inside the owncloud/apps folder
+# * the private key is located in ~/.owncloud/news.key
+# * the certificate is located in ~/.owncloud/news.crt
+occ=$(CURDIR)/../../occ
+private_key=$(HOME)/.owncloud/$(app_name).key
+certificate=$(HOME)/.owncloud/$(app_name).crt
+sign="$(occ) integrity:sign-app --privateKey=$(private_key) --certificate=$(certificate)"
+
all: build
# Fetches the PHP and JS dependencies and compiles the JS. If no composer.json
@@ -116,6 +126,11 @@ source:
--exclude=/build/ \
--exclude=/js/node_modules/ \
--exclude=*.log
+ifneq ($(wildcard $(private_key)),)
+ $(sign) --path $(source_build_directory)
+else
+ @echo "Skipping signing, no key and certificate found in $(private_key) and $(certificate)"
+endif
tar -cvzf $(source_package_name).tar.gz -C $(source_build_directory)/../ $(app_name)
# Builds the source package for the app store, ignores php and js tests
@@ -159,7 +174,12 @@ appstore:
"js/build/app.min.js" \
"js/admin/Admin.js" \
$(appstore_build_directory)
- tar -cvzf $(appstore_package_name).tar.gz -C $(appstore_build_directory)/../ $(app_name)
+ifneq ($(wildcard $(private_key)),)
+ $(sign) --path $(appstore_build_directory)
+else
+ @echo "Skipping signing, no key and certificate found in $(private_key) and $(certificate)"
+endif
+ tar -czf $(appstore_package_name).tar.gz -C $(appstore_build_directory)/../ $(app_name)
# Command for running JS and PHP tests. Works for package.json files in the js/