From efaf3f60564cdf67f39f49326586592e85e51010 Mon Sep 17 00:00:00 2001
From: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
Date: Fri, 19 Mar 2021 19:37:18 +0100
Subject: [PATCH] gitlab-ci.yml: use OHOS_CI_GIT_REPO_PATH

With the improved .workspace and .build jobs merged into the manifest
repository [1], we can now set OHOS_CI_GIT_REPO_PATH and remove the
custom code that was necessary to implement this functionality before.

[1] https://git.ostc-eu.org/OSTC/OHOS/manifest/-/merge_requests/53

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
---
 .ostc-ci/gitlab-ci.yml | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/.ostc-ci/gitlab-ci.yml b/.ostc-ci/gitlab-ci.yml
index 14b7850e..e4083808 100644
--- a/.ostc-ci/gitlab-ci.yml
+++ b/.ostc-ci/gitlab-ci.yml
@@ -26,7 +26,7 @@ include:
     - 'reuse.yaml'
  - project: 'OSTC/OHOS/manifest'
    file:
-    # Include the set of build flavours.
+    # Include the set of generic build rules.
     - '.ostc-ci/build-generic.yaml'
     # Include the set of build flavours.
     - '.ostc-ci/build-flavours.yaml'
@@ -43,8 +43,7 @@ reuse:
 
 
 # Customize the generic .build job, included from build-generic.yaml above,
-# with an unique set of rules that enable the job and an override for the
-# OHOS_MANIFEST_BRANCH variable.
+# with settings for testing updates to the meta-ohos git repository.
 .build:
   variables:
     # The path of the git repository to deviate from what the git-repo manifest
@@ -52,23 +51,7 @@ reuse:
     # repository holding this CI pipeline.
     #
     # The path is relative to the checked out "sources/" directory.
-    OHOS_GIT_REPO_PATH: "meta-ohos"
-  before_script:
-    # XXX: This test is repeated from build-generic.yaml .build before_script,
-    # de-duplicate that by moving this logic back to the generic script.
-    - test -n "$OHOS_RECIPE_NAME" || (
-        echo "precondition failed - set OHOS_RECIPE_NAME to the name of the recipe to build"
-        && exit 1 )
-    # Check if the job is configured properly.
-    - test -n "$OHOS_GIT_REPO_PATH" || (
-        echo "precondition failed - set OHOS_GIT_REPO_PATH to the path of the git repository as described by the manifest"
-        && exit 1 )
-    - !reference [.workspace, before_script]
-    # Switch the git repository which is being tested to the revision described
-    # by the CI environment variables. This effectively performs the update
-    # corresponding to the layer landing in either stable manifest or the
-    # development manifest.
-    - ( cd "$SCRATCH_DIR"/sources/"$OHOS_GIT_REPO_PATH" && git checkout "$CI_COMMIT_SHA" )
+    OHOS_CI_GIT_REPO_PATH: "meta-ohos"
   artifacts:
     # Disable collection of image artifacts. They are not used here and they
     # are expensive to upload and store.
-- 
GitLab