Commit a1146389 authored by Beatriz Rizental's avatar Beatriz Rizental Committed by Pier Angelo Vendrame
Browse files

fixup! Add CI for Base Browser

parent 52881321
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ variables:
  LOCAL_REPO_PATH: /srv/apps-repos/tor-browser.git

include:
  - local: '.gitlab/ci/mixins.yml'
  - local: '.gitlab/ci/jobs/lint/lint.yml'
  - local: '.gitlab/ci/jobs/startup-test/startup-test.yml'
  - local: '.gitlab/ci/jobs/update-containers.yml'
+1 −15
Original line number Diff line number Diff line
.base:
  extends: .with-local-repo-bash
  stage: lint
  image: $IMAGE_PATH
  interruptible: true
  variables:
    MOZBUILD_STATE_PATH: "$CI_PROJECT_DIR/.cache/mozbuild"
    # A copy of the repository already is available in the runner.
    GIT_STRATEGY: "none"
  cache:
    paths:
      - node_modules
@@ -17,19 +16,6 @@
  tags:
    # Run these jobs in the browser dedicated runners.
    - firefox
  before_script:
    - git init
    - git remote add local "$LOCAL_REPO_PATH"
    - git fetch --depth 500 local
    - git remote add origin "$CI_REPOSITORY_URL"
    - |
      if [ -z "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" ]; then
          echo "No branch specified. Stopping the pipeline."
          exit 1
      fi
    - echo "Fetching from remote branch ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
    - git fetch origin "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
    - git checkout origin/${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}

eslint:
  extends: .base

.gitlab/ci/mixins.yml

0 → 100644
+47 −0
Original line number Diff line number Diff line
.with-local-repo-bash:
  variables:
      GIT_STRATEGY: "none"
  before_script:
    - git init
    - git remote add local "$LOCAL_REPO_PATH"
    - git fetch --depth 500 local
    - git remote add origin "$CI_REPOSITORY_URL"
    - |
      if [ -z "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" ]; then
          echo "No branch specified. Stopping the pipeline."
          exit 1
      fi
    - echo "Fetching from remote branch ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
    - |
      if ! git fetch origin "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"; then
            echo -e "\e[31mFetching failed for branch ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} from $CI_REPOSITORY_URL.\e[0m"
            echo "Attempting to fetch the merge request branch, assuming this pipeline is not running in a fork."
            git fetch origin "merge-requests/${CI_MERGE_REQUEST_IID}/head"
      fi
    - git checkout origin/${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}

.with-local-repo-pwsh:
  variables:
      GIT_STRATEGY: "none"
  before_script:
    - git init
    - git remote add local $env:LOCAL_REPO_PATH
    - git fetch --depth 500 local
    - git remote add origin $env:CI_REPOSITORY_URL
    - |
      $branchName = $env:CI_COMMIT_BRANCH
      if ([string]::IsNullOrEmpty($branchName)) {
          $branchName = $env:CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
      }
      if ([string]::IsNullOrEmpty($branchName)) {
          Write-Output "No branch specified. Stopping the pipeline."
          exit 1
      }
    - Write-Output "Fetching from remote branch $branchName"
    - |
      if (! git fetch origin $branchName) {
        Write-Output "Fetching failed for branch $branchName from $env:CI_REPOSITORY_URL."
        Write-Output "Attempting to fetch the merge request branch, assuming this pipeline is not running in a fork."
        git fetch origin "merge-requests/$env:CI_MERGE_REQUEST_IID/head"
      }
    - git checkout origin/$branchName