Skip to content
Snippets Groups Projects
Verified Commit f2a079be authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

.gitlab-ci.yml: Flatten repository on openharmony-readthedocs-aggregated


This is currently only done for the main branch. For every new push to
this branch, the pipeline will push a flatten version of it on the main
branch of openharmony-readthedocs-aggregated referencing the origin
branch and SHA in the commit log.

Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent 7195ed58
No related branches found
No related tags found
No related merge requests found
......@@ -72,19 +72,20 @@ deploy:
- *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
- git checkout origin/main # only main for now - needs to match the rules
- find . -maxdepth 1 -not -path ./.git -not -path . -exec rm -rf {} \;
- tar -c --dereference -C .. --exclude openharmony-readthedocs-aggregated --exclude ./.git . | tar -x
# 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
if [ -n "$(git status -s)" ]; then
msg="docs repository snapshot - $CI_COMMIT_BRANCH:$CI_COMMIT_SHA";
git config --local user.name "OpenHarmony CI";
git config --local user.email "ci@ostc-eu.org";
git add -A
git commit -sm "$msg";
git push origin HEAD:main;
else
echo "Nothing new to commit.";
fi
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "main"'
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