File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010# rspec failure tracking
1111.rspec_status
12+ .codeclimate_diff.yml
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33require "rest-client"
4+ require "yaml"
45
56module CodeclimateDiff
67 class Downloader
78
89 def self . refresh_baseline_if_configured
9- should_download = CodeclimateDiff . configuration . gitlab [ :download_baseline_from_pipeline ]
10+
11+ config = YAML . load_file ( "./.codeclimate_diff.yml" )
12+
13+ puts config
14+
15+ should_download = config [ 'gitlab' ] [ 'download_baseline_for_pipeline' ]
1016 return unless should_download
1117
12- branch_name = CodeclimateDiff . configuration . gitlab [ :main_branch_name ]
13- project_id = CodeclimateDiff . configuration . gitlab [ :project_id ]
14- host = CodeclimateDiff . configuration . gitlab [ :host ]
15- personal_access_token = CodeclimateDiff . configuration . gitlab [ :personal_access_token ]
18+ puts "downloading baseline file from gitlab"
19+ branch_name = config [ 'gitlab' ] [ 'main_branch_name' ]
20+ project_id = config [ 'gitlab' ] [ 'project_id' ]
21+ host = config [ 'gitlab' ] [ 'host' ]
22+ personal_access_token = config [ 'gitlab' ] [ 'personal_access_token' ]
1623
1724 # curl --output codeclimate_diff_baseline.json --header "PRIVATE-TOKEN: MYTOKEN" "https://gitlab.digitalnz.org/api/v4/projects/85/jobs/artifacts/main/raw/codeclimate_diff_baseline.json?job=code_quality"
1825 url = "#{ host } /api/v4/projects/#{ project_id } /jobs/artifacts/#{ branch_name } /raw/codeclimate_diff_baseline.json?job=code_quality"
You can’t perform that action at this time.
0 commit comments