aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Trevor Elliott <trevor@galois.com>2013-06-18 13:34:51 -0700
committerGravatar Trevor Elliott <trevor@galois.com>2013-06-18 13:34:51 -0700
commit272df570e7536e4115db604f939e6c9af4ce2489 (patch)
treeb313029fa6a49f001af6653f8944489248daac9b /Makefile
parent6820f63a15df2e286b956dac9bcd7006a2100361 (diff)
Add generate and deploy targets to push extensions to gh-pages
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 017649b..2cb7956 100644
--- a/Makefile
+++ b/Makefile
@@ -80,3 +80,41 @@ $(eval $(call subdir,src/batchtools))
$(eval $(call subdir,profiles))
$(eval $(call subdir,doc))
+
+
+# Package Deployment ###########################################################
+
+ifeq "$(git-cmd)" ""
+$(call strict-error,"unable to locate git")
+else
+
+remote-url := $(shell $(git-cmd) config remote.origin.url)
+
+$(build-dir)/gh-pages: $(topdir)/.git/index | $(build-dir)
+ $(call label,CLONE $(call drop-prefix,$@))\
+ ( $(git-cmd) clone $(if $(Q),-q) $(topdir) $@ \
+ && cd $@ \
+ && $(git-cmd) remote set-url origin $(remote-url) \
+ && $(git-cmd) fetch $(if $(Q),-q) origin \
+ && $(git-cmd) checkout $(if $(Q),-q) gh-pages )
+
+$(build-dir)/gh-pages/binaries/%: $(build-dir)/% \
+ | $(build-dir)/gh-pages
+ $(call cmd,cp)
+
+.PHONY: genereate
+generate: $(build-dir)/gh-pages/binaries/fiveui.xpi \
+ $(build-dir)/gh-pages/binaries/fiveui.crx
+ $(call label,GENERATE)\
+ ( cd $(build-dir)/gh-pages \
+ && $(git-cmd) add binaries \
+ && $(git-cmd) add -u binaries \
+ && $(git-cmd) commit $(if $(Q),-q) -m "deploy extensions" )
+
+.PHONY: deploy
+deploy: generate
+ $(call label,DEPLOY)\
+ ( cd $(build-dir)/gh-pages \
+ && git push $(if $(Q),-q) origin gh-pages )
+
+endif