Skip to content
Snippets Groups Projects
Commit 778c8301 authored by Zygmunt Krynicki's avatar Zygmunt Krynicki Committed by Andrei Gherzan
Browse files

gitlab-ci.yml: use new jobs from the manifest repo


The .workspace and .build-docs allow simplification of the two similar
jobs present into this repository. The .workspace job completely
replaces the local copy, with a single configuration variable to enable
testing of incoming changes.

The build job becomes build-docs and extends both the .workspace job and
the .build-docs job, reusing both the scripts to perform everything that
was formerly specified explicitly.

The deploy job now extends the .workspace job but is otherwise
unchanged.

Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
parent 24b27fd0
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,8 @@ include: ...@@ -12,6 +12,8 @@ include:
file: file:
- 'dco.yaml' - 'dco.yaml'
- 'reuse.yaml' - 'reuse.yaml'
- project: 'OSTC/OHOS/manifest'
file: '.ostc-ci/build-generic.yaml'
dco: dco:
extends: .dco extends: .dco
...@@ -24,52 +26,36 @@ reuse: ...@@ -24,52 +26,36 @@ reuse:
rules: rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
.doc-workspace: # Customize the .workspace job to set the path of the git repository to deviate
image: # from what the git-repo manifest prepares. This effectively allows testing
name: registry.ostc-eu.org/ostc/containers/ostc-docs-builder # incoming changes that match the repository holding this CI pipeline.
tags: [large-disk] .workspace:
variables: variables:
OHOS_MANIFEST_URL: https://git.ostc-eu.org/OSTC/OHOS/manifest
OHOS_MANIFEST_BRANCH: develop
OHOS_MANIFEST_NAME: default.xml
OHOS_GIT_REPO_PATH: docs OHOS_GIT_REPO_PATH: docs
before_script: &doc-workspace-before
- test ! -e "$CI_PROJECT_DIR"/.scratch-dir-name || (
echo "precondition failed - concurrent modification of $CI_PROJECT_DIR"
&& env | grep CI_ | sort
&& ls -l
&& exit 1 )
- SCRATCH_DIR="$(mktemp -p /tmp -d workspace.XXXXXXXXXX)"
- echo "$SCRATCH_DIR" > "$CI_PROJECT_DIR"/.scratch-dir-name
- cd "$SCRATCH_DIR"
- repo init --reference
/var/shared/pub/git-repo-mirrors/ostc-develop
--manifest-url "$OHOS_MANIFEST_URL"
--manifest-name "$OHOS_MANIFEST_NAME"
--manifest-branch "$OHOS_MANIFEST_BRANCH"
- time repo sync --no-clone-bundle
- ( cd "$SCRATCH_DIR"/"$OHOS_GIT_REPO_PATH" && git checkout "$CI_COMMIT_SHA" )
script: &doc-workspace-do
- SCRATCH_DIR="$(cat "$CI_PROJECT_DIR"/.scratch-dir-name)"
- cd "$SCRATCH_DIR"/docs
build: # Disable all the bitbake jobs, since we are not building any code here.
extends: .doc-workspace .bitbake-workspace:
stage: build
script:
- *doc-workspace-do
- make BUILD_DIR="$CI_PROJECT_DIR/build"
artifacts:
paths:
- build
rules: rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: never
# Define a build-docs job that extends both the .workspace, for the general
# workspace setup, and .build-docs, for the documentation build logic. The
# script first assembles the workspace and then proceeds to build the
# documentation.
#
# The job extends more than one parent, with the order being relevant for,
# among others, the "rules" section.
build-docs:
extends: [.workspace, .build-docs]
script:
- !reference [.workspace, script]
- !reference [.build-docs, script]
deploy: deploy:
extends: .doc-workspace extends: .workspace
stage: deploy stage: deploy
script: script:
- *doc-workspace-do - !reference [.workspace, script]
- git clone https://user:$OHOS_AGGREGATED_DOCS_TOKEN@git.ostc-eu.org/OSTC/infrastructure/openharmony-readthedocs-aggregated.git - git clone https://user:$OHOS_AGGREGATED_DOCS_TOKEN@git.ostc-eu.org/OSTC/infrastructure/openharmony-readthedocs-aggregated.git
- cd openharmony-readthedocs-aggregated - cd openharmony-readthedocs-aggregated
- git checkout origin/main # only main for now - needs to match the rules - git checkout origin/main # only main for now - needs to match the rules
......
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