image: ruby:2.4 stages: - prepare - test - triage .default-cache-config: &default-cache-config key: "ruby-2.4" paths: - vendor/cache/ - Gemfile.lock .pull-cache: &pull-cache cache: <<: *default-cache-config policy: pull before_script: - gem install bundler - bundle --version - bundle update --jobs $(nproc) --retry 3 --quiet ################### ## Prepare stage ## ################### setup-test-env: stage: prepare script: - echo "All set!" cache: <<: *default-cache-config artifacts: paths: - vendor/cache/ - Gemfile.lock ################ ## Test stage ## ################ styles: <<: *pull-cache stage: test script: - bundle exec rubocop specs: <<: *pull-cache stage: test script: - bundle exec rake spec codequality: <<: *pull-cache image: docker:latest stage: test variables: DOCKER_DRIVER: overlay services: - docker:dind before_script: [] script: - docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate analyze -f json > raw_codeclimate.json - cat raw_codeclimate.json | docker run -i stedolan/jq -c 'map({check_name,fingerprint,location})' > codeclimate.json artifacts: paths: - codeclimate.json ################## ## Triage stage ## ################## dry-run:bin:gitlab-triage: <<: *pull-cache stage: triage script: - bundle exec rake install:local - gitlab-triage --help - gitlab-triage --dry-run --debug --token $API_TOKEN --project-id $CI_PROJECT_PATH dry-run:bin:gitlab-ce: <<: *pull-cache stage: triage script: - bundle exec rake install:local - gitlab-triage --help - gitlab-triage --dry-run --debug --token $API_TOKEN --project-id gitlab-org/gitlab-ce when: manual dry-run:gem:gitlab-triage: <<: *pull-cache stage: triage script: - gem install gitlab-triage - gitlab-triage --help - gitlab-triage --dry-run --debug --token $API_TOKEN --project-id $CI_PROJECT_PATH when: manual