diff --git a/.drone.star b/.drone.star index 48b1d56ea6..3c64628d02 100644 --- a/.drone.star +++ b/.drone.star @@ -80,6 +80,7 @@ def getCoreApiTestPipelineNames(): return names def main(ctx): + pipelines = [] before = testPipelines(ctx) stages = [ @@ -97,11 +98,17 @@ def main(ctx): changelog(ctx), readme(ctx), badges(ctx), - website(ctx), + docs(ctx), updateDeployment(ctx) ] - return before + stages + after + if '[docs-only]' in ctx.build.message: + pipelines = docs(ctx) + pipelines['depends_on'] = [] + else: + pipelines = before + stages + after + + return pipelines def testPipelines(ctx): pipelines = [] @@ -735,7 +742,7 @@ def manifest(ctx): } def changelog(ctx): - repo_slug = ctx.build.source_repo if ctx.build.source_repo else ctx.repo.slug + repo_slug = ctx.build.source if ctx.build.source else ctx.repo.slug return { 'kind': 'pipeline', 'type': 'docker', @@ -909,16 +916,38 @@ def badges(ctx): }, } -def website(ctx): +def docs(ctx): return { 'kind': 'pipeline', 'type': 'docker', - 'name': 'website', + 'name': 'docs', 'platform': { 'os': 'linux', 'arch': 'amd64', }, 'steps': [ + { + 'name': 'prepare', + 'image': 'owncloudci/alpine:latest', + 'commands': [ + 'make docs-copy' + ], + }, + { + 'name': 'test', + 'image': 'owncloudci/hugo:0.71.0', + 'commands': [ + 'cd hugo', + 'hugo', + ], + }, + { + 'name': 'list', + 'image': 'owncloudci/alpine:latest', + 'commands': [ + 'tree hugo/public', + ], + }, { 'name': 'publish', 'image': 'plugins/gh-pages:1', diff --git a/Makefile b/Makefile index ae21a2ed07..f4d864b03e 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,6 @@ SHELL := bash NAME := ocis IMPORT := github.com/owncloud/$(NAME) HUGO := hugo -EXTENSIONS := accounts glauth graph konnectd ocis-phoenix ocis-reva ocs proxy settings store thumbnails webdav .PHONY: all all: build @@ -15,25 +14,28 @@ sync: clean: rm -rf $(HUGO) -.PHONY: generate-docs $(EXTENSIONS) -generate-docs: $(EXTENSIONS) -$(EXTENSIONS): - $(MAKE) -C $@ docs; \ - mkdir -p docs/extensions/$@; \ - cp -R $@/docs/ docs/extensions/$@ +.PHONY: docs-copy +docs-copy: + mkdir -p $(HUGO); \ + mkdir -p $(HUGO)/content/; \ + cd $(HUGO); \ + git init; \ + git remote rm origin; \ + git remote add origin https://github.com/owncloud/owncloud.github.io; \ + git fetch --depth=1; \ + git checkout origin/source -f; \ + rsync --delete -ax --exclude 'static' ../docs/ content/; \ -.PHONY: clean-docs -clean-docs: - rm -rf docs +.PHONY: config-docs-generate +config-docs-generate: + go run github.com/owncloud/flaex >| docs/configuration.md -.PHONY: ocis-docs -ocis-docs: - mkdir -p docs/ocis; \ - $(MAKE) -C ocis docs; \ - cp -R ocis/docs/ docs/ocis +.PHONY: docs-build +docs-build: + cd $(HUGO); hugo .PHONY: docs -docs: clean-docs generate-docs ocis-docs +docs: docs-copy docs-build BEHAT_BIN=vendor-bin/behat/vendor/bin/behat