8181include .make/recursion.mk
8282
8383.PHONY : help
84+ DEFAULT_GOAL := help
8485help :
8586 @echo " Please use 'make <target>' where <target> is one of the following:"
8687 @echo
88+ @echo -e " ${GREEN} List all available .PHONY targets:${RESET} \n"
89+ @echo -e " \tmake list\t\t${BLUE} sorted alphabetically${RESET} "
90+ @echo -e " ${BLACK} ---------------------------------------------------------${RESET} "
8791 @echo -e " ${GREEN} Testing with test suite natively installed:${RESET} \n"
8892 @echo -e " ${PURPLE} \tdocs: https://owncloud.dev/ocis/development/testing/#testing-with-test-suite-natively-installed${RESET} \n"
8993 @echo -e " \tmake test-acceptance-api\t\t${BLUE} run API acceptance tests${RESET} "
@@ -94,14 +98,13 @@ help:
9498 @echo -e " ${RED} You also should have a look at other available Makefiles:${RESET} "
9599 @echo
96100 @echo -e " ${GREEN} oCIS:${RESET} \n"
97- @echo -e " ${PURPLE} \tdocs: https://owncloud.dev/ocis/development /build/${RESET} \n"
101+ @echo -e " ${PURPLE} \tdocs: https://owncloud.dev/ocis/ocis /build-docs /${RESET} \n"
98102 @echo -e " \tsee ./ocis/Makefile"
99103 @echo -e " \tor run ${YELLOW} make -C ocis help${RESET} "
100104 @echo
101105 @echo -e " ${GREEN} Documentation:${RESET} \n"
102- @echo -e " ${PURPLE} \tdocs: https://owncloud.dev/ocis/development/build-docs/${RESET} \n"
103- @echo -e " \tsee ./docs/Makefile"
104- @echo -e " \tor run ${YELLOW} make -C docs help${RESET} "
106+ @echo -e " ${PURPLE} \tdocs: https://owncloud.dev/ocis/build-docs/${RESET} \n"
107+ @echo -e " \trun ${YELLOW} make list | grep docs-\t\t${BLUE} note: run all docs command via this makefile${RESET} "
105108 @echo
106109 @echo -e " ${GREEN} Testing with test suite in docker:${RESET} \n"
107110 @echo -e " ${PURPLE} \tdocs: https://owncloud.dev/ocis/development/testing/#testing-with-test-suite-in-docker${RESET} \n"
@@ -117,6 +120,12 @@ help:
117120 @echo -e " \tmake test-gherkin-lint-fix\t${BLUE} apply lint fixes to gherkin feature files${RESET} "
118121 @echo
119122
123+ .PHONY : list
124+ list :
125+ @echo -e ' Available .PHONY targets: \n'
126+ @grep -P -o ' (?<=^\.PHONY: )(.*)' Makefile | sort -u
127+ @echo
128+
120129.PHONY : clean-tests
121130clean-tests :
122131 @rm -Rf vendor-bin/** /vendor vendor-bin/** /composer.lock tests/acceptance/output
@@ -159,33 +168,57 @@ clean:
159168 $(MAKE) --no-print-directory -C $$mod clean || exit 1; \
160169 done
161170
162- .PHONY : docs-generate
171+ # generate the docs
172+ # intents and comments are intentional...
173+ .PHONY : docs-generate # 1. prepare docs
163174docs-generate :
164- # empty the folders first to only have files that are generated without remnants
175+ @echo ' Empty folders first to only have those files that are generated without remnants. '
165176 find docs/services/_includes/ -type f \( -name " *" ! -name " .git*" \) -delete || exit 1
166177
167- # generate the services md files for dev docs
178+ @echo 'Generate content from services.'
168179 @for mod in $(OCIS_MODULES); do \
169180 $(MAKE) --no-print-directory -C $$mod docs-generate || exit 1; \
170181 done
171182
172- # generate envvar adoc and md tables for dev and admin docs
173- $(MAKE) --no-print-directory -C docs docs-generate || exit 1
174-
175- # only copy all added/removed/deprecated files that have been created for a release + .gitkeep
176- # note that files are locally ignored via _include/.gitignore for pushing, but required by the drone process
177- # for markdown, if e.g. an `_index.md` file would be present containing links, hugo thinks it must render and fails
178- # the -I flag followed by % cp % means that all passed arguments will concatenated to the last %
179- find docs/services/general-info/envvars/env-var-deltas/ -type f \( -name ".gitkeep" -o -name "*-added.*" -o -name "*-removed.*" -o -name "*-deprecated.*" \) | xargs -I % cp % docs/services/_includes/adoc/env-var-deltas/
180-
181- .PHONY : docs-drone-test
182- # imitate a full drone run to build docs without pushing to the web.
183- # this can help identify uncaught issues when running `make -C docs docs-serve` only.
184- docs-drone-test :
185- $(MAKE ) --no-print-directory docs-generate
186- $(MAKE ) --no-print-directory -C docs docs-copy
187- $(MAKE ) --no-print-directory -C docs test
188-
183+ @$(MAKE) --no-print-directory -C docs docs-run-helpers || exit 1
184+
185+ # initialize the docs build environment
186+ @$(MAKE) --no-print-directory -C docs docs-init
187+
188+ # copy required resources into hugo/content
189+ .PHONY : docs-copy # 2. copy required doc resources
190+ docs-copy :
191+ @$(MAKE ) --no-print-directory -C docs docs-copy
192+
193+ # the docs-build|serve commands requires that docs-init was run first for the required data to exists
194+ # create a docs build
195+ .PHONY : docs-build # 3. build prepared docs
196+ docs-build :
197+ @$(MAKE ) --no-print-directory -C docs docs-build
198+
199+ # serve built docs with hugo
200+ .PHONY : docs-serve # serve the docs build
201+ docs-serve :
202+ @$(MAKE ) --no-print-directory -C docs docs-serve
203+
204+ # clean up doc build artifacts
205+ .PHONY : docs-clean # clean all docs artifacts, must be run as sudo
206+ docs-clean :
207+ @$(MAKE ) --no-print-directory -C docs docs-clean
208+
209+ # imitate a full drone run locally to build docs without pushing to the web.
210+ # this can help identify uncaught issues when running `make docs-serve` only.
211+ .PHONY : docs-local # run all steps as drone would do it (1, 2, 3)
212+ docs-local :
213+ @$(MAKE ) --no-print-directory docs-generate
214+ @$(MAKE ) --no-print-directory docs-copy
215+ @$(MAKE ) --no-print-directory docs-build
216+
217+ # prepare a link from the root to the hugo folder because the image requires it
218+ # note that on local building, the referenced container of inside the hugo/makefile is used
219+ .PHONY : docs-hugo-drone-prep # only used for drone !
220+ docs-hugo-drone-prep :
221+ @$(MAKE ) --no-print-directory -C docs docs-hugo-drone-prep
189222
190223.PHONY : check-env-var-annotations
191224check-env-var-annotations :
0 commit comments