From 15475b3f6b5ec1d6cb1b15263c12b3cfd500a315 Mon Sep 17 00:00:00 2001 From: Zygmunt Krynicki <zygmunt.krynicki@huawei.com> Date: Mon, 19 Sep 2022 10:50:13 +0000 Subject: [PATCH] ci: remove aggregated directory from previous runs The .oniro-repo-workspace job uses GIT_STRATEGY=none, so CI_PROJECT_DIR is not cleaned up between jobs. As a consequence, the "aggregated" repository checkout may be present on job startup, thus upsetting remaining logic. Remvoe the aggregated repository before starting the build. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com> --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3743d24..86fa5d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -145,7 +145,10 @@ deploy: name: registry.ostc-eu.org/ostc/oniro/docs-builder:latest stage: deploy script: - # We are in the root of the git-repo workspace. + # We are in the root of the git-repo workspace. Because + # .oniro-repo-workspace uses GIT_STRATEGY=none, the workspace is not + # cleaned automatically. + - rm -rf aggregated - git clone https://user:$CI_ONIRO_AGGREGATED_DOCS_TOKEN@gitlab.eclipse.org/eclipse/oniro-core/oniro-readthedocs-aggregated.git aggregated - find aggregated -maxdepth 1 -not -path aggregated/.git -not -path aggregated -exec rm -rvf {} \; - tar -c --dereference -C docs --exclude ./.git --exclude ./.gitlab-ci.yml . | tar -x -C aggregated -- GitLab