.package-and-qa-base:
  image: ruby:2.6-alpine
  stage: review  # So even if review-deploy failed we can still run this
  before_script: []
  dependencies: []
  cache: {}
  variables:
    GIT_DEPTH: "1"
  retry: 0
  script:
    - source scripts/utils.sh
    - install_gitlab_gem
    - ./scripts/trigger-build omnibus
  only:
    - branches@gitlab-org/gitlab-ce
    - branches@gitlab-org/gitlab-ee

package-and-qa-manual:
  extends:
    - .package-and-qa-base
    - .no-docs-and-no-qa
  when: manual

package-and-qa:
  extends: .package-and-qa-base
  allow_failure: true
  only:
    - /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab-ce
    - /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab-ee

.package-and-qa-base:
  image: ruby:2.6-alpine
  stage: qa
  before_script: []
  needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
  dependencies: []
  cache: {}
  variables:
    GIT_DEPTH: "1"
  retry: 0
  script:
    - source scripts/utils.sh
    - install_gitlab_gem
    - ./scripts/trigger-build omnibus
  only:
    - branches@gitlab-org/gitlab-ce
    - branches@gitlab-org/gitlab-ee
  except:
    - master

package-and-qa-manual:
  extends: .package-and-qa-base
  when: manual
  except:
    - master
    - /(^docs[\/-].+|.+-docs$)/
    - /(^qa[\/-].*|.*-qa$)

package-and-qa:
  extends: .package-and-qa-base
  allow_failure: true
  only:
    - /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab-ce
    - /(^qa[\/-].*|.*-qa$)/@gitlab-org/gitlab-ee

Use the 'needs' keyword for 'package-and-qa-always' job
Use the 'needs' keyword for 'package-and-qa-always' job

Signed-off-by: Rémy Coutable <4ea0184b9df19e0786dd00b28e6daa4d26baeb3e@rymai.me>
