Loading .gitlab-ci.yml +1 −0 Original line number Diff line number Diff line Loading @@ -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' Loading .gitlab/ci/jobs/lint/lint.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 Loading @@ -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 Loading .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 Loading
.gitlab-ci.yml +1 −0 Original line number Diff line number Diff line Loading @@ -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' Loading
.gitlab/ci/jobs/lint/lint.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 Loading @@ -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 Loading
.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