File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 9
9
10
10
# rspec failure tracking
11
11
.rspec_status
12
+ .codeclimate_diff.yml
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
require "rest-client"
4
+ require "yaml"
4
5
5
6
module CodeclimateDiff
6
7
class Downloader
7
8
8
9
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' ]
10
16
return unless should_download
11
17
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' ]
16
23
17
24
# 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"
18
25
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