diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..1be070528475f09744ef30857412a8d9705bc4ea --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Huawei Inc. + +stages: + - compliance + - test + - build + - deploy + +include: + - project: 'OSTC/infrastructure/pipelines' + file: + - 'dco.yaml' + - 'reuse.yaml' + +dco: + extends: .dco + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + +reuse: + extends: .reuse + allow_failure: true + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + +.doc-workspace: + image: + name: registry.ostc-eu.org/ostc/containers/ostc-docs-builder + tags: [large-disk] + variables: + OHOS_MANIFEST_URL: https://git.ostc-eu.org/OSTC/OHOS/manifest + OHOS_MANIFEST_BRANCH: develop + OHOS_MANIFEST_NAME: develop.xml + OHOS_GIT_REPO_PATH: docs + before_script: &doc-workspace-before + - test ! -e "$CI_PROJECT_DIR"/.scratch-dir-name || ( + echo "precondition failed - concurrent modification of $CI_PROJECT_DIR" + && env | grep CI_ | sort + && ls -l + && exit 1 ) + - SCRATCH_DIR="$(mktemp -p /tmp -d workspace.XXXXXXXXXX)" + - echo "$SCRATCH_DIR" > "$CI_PROJECT_DIR"/.scratch-dir-name + - cd "$SCRATCH_DIR" + - repo init --reference + /var/shared/pub/git-repo-mirrors/ostc-develop + --manifest-url "$OHOS_MANIFEST_URL" + --manifest-name "$OHOS_MANIFEST_NAME" + --manifest-branch "$OHOS_MANIFEST_BRANCH" + - time repo sync --no-clone-bundle + - test -d sources || ( + echo "assumption violated - expected the workspace to contain the sources directory" + && ls "$SCRATCH_DIR" + && exit 1 ) + - ( cd "$SCRATCH_DIR"/sources/"$OHOS_GIT_REPO_PATH" && git checkout "$CI_COMMIT_SHA" ) + script: &doc-workspace-do + - SCRATCH_DIR="$(cat "$CI_PROJECT_DIR"/.scratch-dir-name)" + - cd "$SCRATCH_DIR"/sources/docs + # Aggregate content from other places + - make -C experimental aggregate + +build: + extends: .doc-workspace + stage: build + script: + - *doc-workspace-do + - make -C experimental build + - mv experimental/build "$CI_PROJECT_DIR" + artifacts: + paths: + - build + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + +deploy: + extends: .doc-workspace + stage: deploy + script: + - *doc-workspace-do + - git clone https://user:$OHOS_AGGREGATED_DOCS_TOKEN@git.ostc-eu.org/OSTC/infrastructure/openharmony-readthedocs-aggregated.git + - cd openharmony-readthedocs-aggregated + - git checkout test # TODO: switch to main / master + - find . -name '*.rst' -delete || true + - tar -c --dereference -C ../experimental . | tar -x + # Clean up files we don't want in the aggregated view + - rm -f .rst-aggregator Makefile + # Commit and push back, if something changed. + - git config --local user.name "OpenHarmony Docs Build System" + - git config --local user.email "nobody@example.org" + - git add . + - | + if ! git status; then + git commit -sm "Automatic snapshot update"; + git push origin test; + fi + rules: + - if: '$CI_COMMIT_BRANCH == "master"' diff --git a/conf.py b/conf.py index 033c06d188e2f15778740e482c3fc205f517b309..347abeb14f3d95477dcfba01b2038f3091a2a8f6 100644 --- a/conf.py +++ b/conf.py @@ -24,13 +24,13 @@ author = 'OSTC' # The full version, including alpha/beta/rc tags release = '1.0' - # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + 'recommonmark' ] # Add any paths that contain templates here, relative to this directory. diff --git a/experimental/.rst-aggregator b/experimental/.rst-aggregator new file mode 100644 index 0000000000000000000000000000000000000000..70fe695a0b847f296885eb0924a32ff2a5a05e88 --- /dev/null +++ b/experimental/.rst-aggregator @@ -0,0 +1 @@ +meta-ohos-acts.md:../../meta-ohos/meta-ohos-acts/README.md diff --git a/experimental/.rst-aggregator.license b/experimental/.rst-aggregator.license new file mode 100644 index 0000000000000000000000000000000000000000..4f5900bfb1a9f08527202fd5e1f6562a55dad164 --- /dev/null +++ b/experimental/.rst-aggregator.license @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Huawei Inc. diff --git a/experimental/Makefile b/experimental/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..827af93500b57556c554ff75c6109578a1335341 --- /dev/null +++ b/experimental/Makefile @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Huawei Inc. + +.PHONY: all +all: build + +.PHONY: clean +clean: + rm -rf build + +.PHONY: aggregate +aggregate: .rst-aggregator + rst-aggregator + +build: $(shell find -name *.rst) + rst-aggregator + sphinx-build -W . $@ diff --git a/experimental/conf.py b/experimental/conf.py new file mode 120000 index 0000000000000000000000000000000000000000..d026d1f6bb8625f2ac82383d883e7d0af7d71e64 --- /dev/null +++ b/experimental/conf.py @@ -0,0 +1 @@ +../conf.py \ No newline at end of file diff --git a/experimental/index.rst b/experimental/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..1bfa0ea4d3124ca11548f3eb847420140c07666a --- /dev/null +++ b/experimental/index.rst @@ -0,0 +1,12 @@ +.. SPDX-FileCopyrightText: Huawei Inc. +.. SPDX-License-Identifier: CC-BY-4.0 + +Welcome to OpenHarmony documentation +#################################### + +Reboot of the documentation system. + +.. toctree:: + :maxdepth: 1 + + meta-ohos-acts diff --git a/experimental/readthedocs.yml b/experimental/readthedocs.yml new file mode 120000 index 0000000000000000000000000000000000000000..09c11f5d89a865d3a6f1d5736bdff347d0123a5c --- /dev/null +++ b/experimental/readthedocs.yml @@ -0,0 +1 @@ +../readthedocs.yml \ No newline at end of file diff --git a/experimental/requirements.txt b/experimental/requirements.txt new file mode 120000 index 0000000000000000000000000000000000000000..dc833dd4befe4d013346e1b2418e3fe91406a7a8 --- /dev/null +++ b/experimental/requirements.txt @@ -0,0 +1 @@ +../requirements.txt \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 64c56a3640157e877c884305c1a06ad8a0b9df9e..bfd35542d8f870d03e162d1bd6cd4f6bef235437 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -six \ No newline at end of file +six +recommonmark