Skip to content
Snippets Groups Projects

ci: allow forks to have different names

Merged Zygmunt Krynicki requested to merge zyga/oniro-docs:fix/project-name into main
1 file
+ 11
1
Compare changes
  • Side-by-side
  • Inline
  • Local manifests are mostly useful for various kinds of pipelines, e.g. for
    merge requests and branch testing. They can use rules:if syntax to modify a
    variable that is later used in shell. Due to the way variable interpolation
    works in GitLab runners, the value itself cannot use further shell constructs,
    like sub-shell substitution.
    
    Introduce CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST_INTERPRETER variable, which
    defaults to "echo" and allows using a custom interpreter. One possible use-case
    is to use "eval" as interpreter and an arbitrary bash program, which is meant
    to print the new local manifest, as value.
    
    Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
+ 11
1
@@ -76,6 +76,16 @@ reuse:
@@ -76,6 +76,16 @@ reuse:
# GitLab cache system, and will be reused between pipelines of the same
# GitLab cache system, and will be reused between pipelines of the same
# project. Note that the .cache directory name is special.
# project. Note that the .cache directory name is special.
CI_ONIRO_MANIFEST_MIRROR_REPO_DIR: $CI_PROJECT_DIR/.cache/repo-mirror
CI_ONIRO_MANIFEST_MIRROR_REPO_DIR: $CI_PROJECT_DIR/.cache/repo-mirror
 
# XML snippet to inject as a "local manifest" for repo. Those allow arbitrary
 
# modifications to the project structure to happen before "repo sync" is used
 
# to construct the workspace.
 
#
 
# The default interpreter for the local manifest is plain "echo". For some
 
# more complex cases, where inline shell is required, use "eval" instead
 
# and put "cat" echo into the local manifest, coupled with a here-doc
 
# value.
 
CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST: ""
 
CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST_INTERPRETER: echo
# Directory where repo workspace is constructed.
# Directory where repo workspace is constructed.
CI_ONIRO_REPO_WORKSPACE_DIR: $CI_PROJECT_DIR/.tmp/repo-workspace
CI_ONIRO_REPO_WORKSPACE_DIR: $CI_PROJECT_DIR/.tmp/repo-workspace
# Use fastest cache compression algorithm, as bulk of the cache is
# Use fastest cache compression algorithm, as bulk of the cache is
@@ -169,7 +179,7 @@ reuse:
@@ -169,7 +179,7 @@ reuse:
- echo "Initializing repository workspace from $CI_ONIRO_MANIFEST_REPO_URL and $CI_ONIRO_MANIFEST_REPO_REV"
- echo "Initializing repository workspace from $CI_ONIRO_MANIFEST_REPO_URL and $CI_ONIRO_MANIFEST_REPO_REV"
- repo init --reference "$CI_ONIRO_MANIFEST_MIRROR_REPO_DIR" --manifest-url "$CI_ONIRO_MANIFEST_REPO_URL" --manifest-branch "$CI_ONIRO_MANIFEST_REPO_REV" --no-clone-bundle
- repo init --reference "$CI_ONIRO_MANIFEST_MIRROR_REPO_DIR" --manifest-url "$CI_ONIRO_MANIFEST_REPO_URL" --manifest-branch "$CI_ONIRO_MANIFEST_REPO_REV" --no-clone-bundle
- mkdir -p "${CI_ONIRO_REPO_WORKSPACE_DIR}/.repo/local_manifests"
- mkdir -p "${CI_ONIRO_REPO_WORKSPACE_DIR}/.repo/local_manifests"
- 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"
- test -n "${CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST:-}" && "$CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST_INTERPRETER" "$CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST" | tee "${CI_ONIRO_REPO_WORKSPACE_DIR}/.repo/local_manifests/local.xml"
- echo "Synchronizing repository workspace"
- echo "Synchronizing repository workspace"
- repo sync --force-sync
- repo sync --force-sync
- gl_section_close repo_workspace_setup
- gl_section_close repo_workspace_setup
Loading