Skip to content
Snippets Groups Projects
Commit 2d881aaa authored by Zygmunt Krynicki's avatar Zygmunt Krynicki
Browse files

Add experimental build pipeline

This pipeline allows aggregation content from other repositories that
participate in our development manifest, performs a local test build
and if successful, exports the content into a new "aggregated docs"
repository at https://git.ostc-eu.org/OSTC/infrastructure/openharmony-readthedocs-aggregated



That repository is compatible with readthedocs build system and only
needs a webhook to trigger automatic builds that show up on the correct
readthedocs subdomain. The webhook needs to be set up separately by
whoever owns the "openharmony" project on readthedocs.

Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
parent a9a31286
No related branches found
No related tags found
No related merge requests found
# 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"'
......@@ -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.
......
meta-ohos-acts.md:../../meta-ohos/meta-ohos-acts/README.md
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Huawei Inc.
# 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 . $@
../conf.py
\ No newline at end of file
.. 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
../readthedocs.yml
\ No newline at end of file
../requirements.txt
\ No newline at end of file
six
\ No newline at end of file
six
recommonmark
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment