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
+ 5
2
Compare changes
  • Side-by-side
  • Inline
  • 0ca76a42
    When the fork of the "docs" repository is called something else, we need to
    refer to it by the real name to successfully perform the replacement for merge
    request pipelines.
    
    Use some bash and CI_MERGE_REQUEST_SOURCE_PROJECT_PATH to find the bare name of
    the project. This works because the variable is re-interpolated by bash during
    job execution.
    
    Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
+ 5
2
@@ -217,7 +217,9 @@ build-docs:
@@ -217,7 +217,9 @@ build-docs:
# thing we can do right now.
# thing we can do right now.
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
variables:
variables:
CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST: >
CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST_INTERPRETER: eval
 
CI_ONIRO_REPO_WORKSPACE_LOCAL_MANIFEST: |
 
cat <<__EOM__
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<manifest>
<!-- remove original docs project entry -->
<!-- remove original docs project entry -->
@@ -225,8 +227,9 @@ build-docs:
@@ -225,8 +227,9 @@ build-docs:
<!-- add remote representing the project -->
<!-- add remote representing the project -->
<remote name="oniro-override" fetch="${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}/../" />
<remote name="oniro-override" fetch="${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}/../" />
<!-- add docs at the exact version are testing -->
<!-- add docs at the exact version are testing -->
<project name="${CI_PROJECT_NAME}" path="docs" remote="oniro-override" revision="${CI_COMMIT_SHA}" />
<project name="$(basename "$CI_MERGE_REQUEST_SOURCE_PROJECT_PATH")" path="docs" remote="oniro-override" revision="${CI_COMMIT_SHA}" />
</manifest>
</manifest>
 
__EOM__
# Or when things land.
# Or when things land.
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
Loading