diff options
author | Clément Bénier <clement.benier@iot.bzh> | 2018-10-19 16:09:32 +0200 |
---|---|---|
committer | Clément Bénier <clement.benier@iot.bzh> | 2018-10-19 17:02:43 +0200 |
commit | 19ebd9b20f69ec1079bead9a14253889415bc70b (patch) | |
tree | 4afae9af9ae31b2d5f88a7b297ab322e312b404e /Makefile | |
parent | 22bb974f69819ebed80e6885cf7def7f0187b18b (diff) |
setupdocs.sh: script to setup agl documentation
This is a standalone script which clones docs-webtemplates and
docs-tools, there are optionnal arguments as branches and destination
directory.
This script can also be used inside webtemplates repo to update doctools
- add setupdocs.sh
- remove docs.json
- checkout Makefile as docs-agl
Change-Id: Ie82a09f071cda5c27446eab9b7a292a5bd4f3536
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 40 |
1 files changed, 10 insertions, 30 deletions
@@ -1,37 +1,23 @@ -DOCTOOLS=doctools -DOCBUILD=$(DOCTOOLS)/docbuild +DOCBUILD=doctools/docbuild VERBOSE=--verbose FETCHTS=.fetch.ts LOCALFETCH=.LocalFetch.ts -define GetFromConfig -$(shell node -p "require('./docs.json').$(1)") -endef - -DOCTOOLSREPO := $(call GetFromConfig,doctools.url) -DOCTOOLSBRANCH := $(call GetFromConfig,doctools.version) - all: help help: @echo "Usage:" - @echo "- make distclean: clean all generated files and repos" @echo "- make clean: clean all generated files" - @echo "- make doctools: clone doctools repository" @echo "- make fetch: fetch the site if necessary" @echo "- make localFetch: fetch the site if necessary but use local file." @echo "- make build: build the site" @echo "- make push: push the built site" @echo "- make serve: serve the site" -.PHONY: distclean -distclean: clean - rm -fr $(DOCTOOLS) - .PHONY: clean -clean: doctools +clean: $(DOCBUILD) $(VERBOSE) --clean rm -f $(FETCHTS) rm -f $(LOCALFETCH) @@ -45,29 +31,23 @@ $(FETCHTS): $(wildcard content/toc/*/fetched_files.yml) $(DOCBUILD) $(VERBOSE) $(LOCAL_FETCHTS) --fetch --force touch $@ -prebuild: - @node -v && [ $$? -eq 0 ] || (echo "Please, make sure nodejs is installed" && false) - @jekyll -v && [ $$? -eq 0 ] || (echo "Please, make sure jekyll is installed" && false) - -.PHONY: doctools -doctools: prebuild - echo $(DOCTOOLSREPO) - @test ! -d $(DOCTOOLS) && git clone -b $(DOCTOOLSBRANCH) $(DOCTOOLSREPO) $(DOCTOOLS) || true - @cd $(DOCTOOLS) && npm install - .PHONY: fetch -fetch: doctools $(FETCHTS) +fetch: $(FETCHTS) @echo "Fetched files up to date." +.PHONY: localFetch +localFetch: $(LOCALFETCH) $(FETCHTS) + @echo "Fetched files up to date and copy local file." + .PHONY: build -build: doctools $(FETCHTS) +build: $(FETCHTS) $(DOCBUILD) $(VERBOSE) --build .PHONY: push -push: doctools $(FETCHTS) +push: $(FETCHTS) $(DOCBUILD) $(VERBOSE) --build --push .PHONY: serve -serve: doctools $(FETCHTS) +serve: $(FETCHTS) $(DOCBUILD) $(VERBOSE) --build --serve |