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

gitlab-ci.yml: Fix aggregation logic


After the deployment of the new .workspace job and its application to
the aggregate-docs job, the job was subtly broken. The initial working
directory that the script was executing in was no longer the docs
directory but the root of the workspace.

Fix this by adjusting the logic slightly, this will also make the
rename of the aggregated git repository easier.

Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
parent d26d7f2e
No related branches found
No related tags found
No related merge requests found
......@@ -67,18 +67,19 @@ deploy:
stage: deploy
script:
- !reference [.workspace, script]
- git clone https://user:$OHOS_AGGREGATED_DOCS_TOKEN@git.ostc-eu.org/OSTC/infrastructure/openharmony-readthedocs-aggregated.git
- cd openharmony-readthedocs-aggregated
- 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 ./.repo --exclude ./.git --exclude ./.gitlab-ci.yml . | tar -x
# We are in the root of the git-repo workspace.
- git clone https://user:$OHOS_AGGREGATED_DOCS_TOKEN@git.ostc-eu.org/OSTC/infrastructure/openharmony-readthedocs-aggregated.git aggregated
- (cd aggregated && git checkout origin/main) # only main for now - needs to match the rules
- (cd aggregated && find . -maxdepth 1 -not -path ./.git -not -path . -exec rm -rf {} \;)
- tar -c --dereference -C docs --exclude --exclude ./.git --exclude ./.gitlab-ci.yml . | tar -x -C aggregated
# Commit and push back, if something changed.
- |
cd aggregated;
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 add -A;
git commit -sm "$msg";
git push origin HEAD:main;
else
......
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