ci: cache repo mirror, not workspace, expand docs
Compare changes
- Zygmunt Krynicki authored
Working with the new documentation CI pipeline has uncovered problems caused by attempts to cache the entire repo workspace. Initially there are no problems but as pipelines are testing subsequent iterations of a branch, history may become non-linear. In one case repo refused to synchronize (with repo sync --force) the updated repository citing lack of common history. In the experimental Oniro pipeline I've since switched to keeping a cache of the git repo mirror, not repo workspace. This also helps with cache hit when multiple releases are being tested, as cache is mostly static (per release) and subsequent pipelines do not fight with each other by overwriting the cache to their preferred state. Some variable names are updated to better reflect what is going on. Ample new documentation is added, as code comments, to explain how things work. Note that some of the defaults are unexpected, as they are coming from the oniro.git pipeline, and eventually will be included. This can be seen as variables defined on the .oniro-repo-workspace job that are subsequently re-defined in the build job. In addition, add explicit cleanup to counteract GIT_STRATEGY=none. Signed-off-by:
Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
+ 112
− 31
@@ -32,45 +32,73 @@ reuse:
@@ -32,45 +32,73 @@ reuse:
<project name="${CI_PROJECT_NAME}" path="docs" remote="oniro-override" revision="${CI_COMMIT_SHA}" />
@@ -84,6 +112,9 @@ reuse:
@@ -84,6 +112,9 @@ reuse:
@@ -93,23 +124,55 @@ reuse:
@@ -93,23 +124,55 @@ reuse:
- echo "Initializing repository workspace from $CI_ONIRO_REPO_WORKSPACE_URL and $CI_ONIRO_REPO_WORKSPACE_REV"
- repo init --manifest-url "$CI_ONIRO_REPO_WORKSPACE_URL" --manifest-branch "$CI_ONIRO_REPO_WORKSPACE_REV" --no-clone-bundle
- test -n "${CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST-}" && echo "$CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST" | tee "${CI_ONIRO_REPO_WORKSPACE_DIR}/.repo/local_manifests/local.xml"
@@ -122,8 +185,26 @@ build-docs:
@@ -122,8 +185,26 @@ build-docs: