Commit 6ea80024 authored by norvell's avatar norvell
Browse files

Keep same commit in pipelines

parent 2b9ec3df
Loading
Loading
Loading
Loading
Loading
+30 −4
Original line number Diff line number Diff line
@@ -238,8 +238,13 @@ stages:
.build-merge-target-binaries: &build-merge-target-binaries
  - current_commit_sha=$(git rev-parse HEAD)
  ### build merge target binaries
  - git checkout $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
  - git pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
  - if [ -f $MERGE_REQUEST_TARGET_FILE ]; then
  -   MERGE_REQUEST_TARGET=$(echo $MERGE_REQUEST_TARGET_FILE)
  - else
  -   echo "MERGE_REQUEST_TARGET_FILE does not exist, exiting!"
  -   exit 1
  - fi
  - git checkout $MERGE_REQUEST_TARGET
  - *activate-debug-mode-info-if-set
  - make clean
  - make -j >> /dev/null
@@ -496,6 +501,9 @@ stages:
.test-job-linux:
  tags:
    - ivas-linux
  needs:
    - job: branch-is-up-to-date-with-target-pre
    - artifacts: true

.build-job-linux:
  stage: build
@@ -1065,6 +1073,12 @@ branch-is-up-to-date-with-target-pre:
        echo "Your branch is behind the target branch, run 'git pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME' to update."
        exit 1
      fi
    - git fetch $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - TARGET_COMMIT=$(git rev-parse origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)
    - echo "TARGET_COMMIT is $TARGET_COMMIT"
    - echo $TARGET_COMMIT > $MERGE_TARGET_COMMIT_FILE
  artifacts:
    - $MERGE_TARGET_COMMIT_FILE

branch-is-up-to-date-with-target-post:
  extends:
@@ -1078,8 +1092,11 @@ branch-is-up-to-date-with-target-post:
    - |
      if [ $commits_behind_count -ne 0 ]; then
        echo "Your branch is behind the target branch, possibly main changed during your pipeline run, run 'git pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME' to update."
        exit 1
        exit 123
      fi
  allow_failure:
    exit_codes:
      - 123

# fail pipeline in the final stage for pipelines on Draft MRs
# this also only runs on Draft MRs, so should always fail
@@ -1126,6 +1143,12 @@ branch-is-up-to-date-with-target-pre:
        echo -e "Your branch is $commits_behind_count commits behind the target branch, run\n\tgit pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME\nto update."
        exit 1
      fi
    - git fetch $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - TARGET_COMMIT=$(git rev-parse origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)
    - echo "TARGET_COMMIT is $TARGET_COMMIT"
    - echo $TARGET_COMMIT > $MERGE_TARGET_COMMIT_FILE
  artifacts:
    - $MERGE_TARGET_COMMIT_FILE

branch-is-up-to-date-with-target-post:
  extends:
@@ -1138,8 +1161,11 @@ branch-is-up-to-date-with-target-post:
    - |
      if [ $commits_behind_count -ne 0 ]; then
        echo -e "Your branch is $commits_behind_count commits behind the target branch, possibly main changed during your pipeline run, run\n\tgit pull origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME\nto update."
        exit 1
        exit 123
      fi
  allow_failure:
    exit_codes:
      - 123

clang-format-check:
  extends: