Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

Unexpected external job to the pipeline #45

Open
candidoma opened this issue Jul 23, 2019 · 2 comments
Open

Unexpected external job to the pipeline #45

candidoma opened this issue Jul 23, 2019 · 2 comments

Comments

@candidoma
Copy link

Hi all,
when i run sonarqube analysis on master branch i see, at the end of the pipeline, an unexpected job.

image

How i can remove it?

This not happens when use another branch, also with publishing enabled.

This is my yaml gitlab file

.quality_variables: &quality_variables
  SONAR_URL: https://xxxxxxxxxxxxxx

.quality_template: &quality_template
  stage: quality
  image: ciricihq/gitlab-sonar-scanner
  <<: *runner
  dependencies:
    - npm:test
  cache: {}
  before_script:
    - echo "sonar.login=${SONAR_TOKEN}" >> sonar-project.properties
  script: 
    - |
      gitlab-sonar-scanner \
      -Dsonar.gitlab.project_id=$CI_PROJECT_ID \
      -Dsonar.gitlab.user_token=$GITLAB_TOKEN \
      -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA \
      -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
  except:
    variables:
      - $SKIP_QUALITY == "true"

quality:preview:
  <<: *quality_template
  variables:
    <<: *quality_variables
    SONAR_ANALYSIS_MODE: "preview"
  only:
    refs:
      - /^epic\/*/
      - /^hotfix\/*/
      - /^feature\/*/
      - test
      
quality:publish:
  <<: *quality_template
  variables:
    <<: *quality_variables
    SONAR_ANALYSIS_MODE: "publish"
  only:
    refs:
      - master

Regards

@kamihouse
Copy link

kamihouse commented Oct 2, 2019

I have the same issue, but adding the "quality" stage as "external".
@Zero-2 Can you understand and solve your issue?

Captura de Tela 2019-10-02 às 15 29 46

sonarqube:
  image: ciricihq/gitlab-sonar-scanner:latest
  stage: Quality
  variables:
    SONAR_URL: "http://abc.xyz/"
    SONAR_ANALYSIS_MODE: "publish"
  script:
    - gitlab-sonar-scanner
      -Dsonar.host.url=${SONAR_URL}
      -Dsonar.projectKey=${CI_PROJECT_NAME}
      -Dsonar.projectName=${CI_PROJECT_NAME}
      -Dsonar.projectVersion=${CI_COMMIT_TAG}
      -Dsonar.links.homepage=${CI_PROJECT_URL}
      -Dsonar.links.ci=${CI_PROJECT_URL}/pipelines
      -Dsonar.links.scm=${CI_REPOSITORY_URL}
      -Dsonar.projectBaseDir=$(pwd)
      -Dsonar.sources=app
      -Dsonar.sourceEncoding=UTF-8
      -Dsonar.exclusions=app/Console/**,app/Exceptions/**
      -Dsonar.gitlab.project_id=${CI_PROJECT_ID}
      -Dsonar.gitlab.commit_sha=${CI_COMMIT_SHA}
      -Dsonar.gitlab.ref_name=${CI_COMMIT_REF_NAME}
      -Dsonar.php.tests.reportPath=${REPORT_PATH}/logfile.xml
      -Dsonar.php.coverage.reportPaths=${REPORT_PATH}/coverage.xml
  except:
    - /^hotfix.*$/i
  allow_failure: true

@kamihouse
Copy link

kamihouse commented Oct 4, 2019

@Zero-2 I found a way around this problem.

Do not enter the property SONAR_ANALYSIS_MODE (preview now is issues nor publish)

PS: However this does not send the review for SonarQube =(

Captura de Tela 2019-10-04 às 11 29 17

sonarqube:
  image: ciricihq/gitlab-sonar-scanner:latest
  stage: Quality
  variables:
    SONAR_URL: "http://abc.xyz/"
  script:
    - ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants