Skip to content

Commit

Permalink
Merge pull request #249 from Fryguy/new_plugin_updates
Browse files Browse the repository at this point in the history
Remove Travis things for new plugin setup
  • Loading branch information
agrare authored Apr 27, 2022
2 parents 799c9ac + 3e07bb2 commit 62628fb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 87 deletions.
4 changes: 0 additions & 4 deletions bin/new_plugin_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
ManageIQ::Release::UpdateBranchProtection.new(repo.github_repo, opts.merge(:branch => "master")).run
puts "\n** Updating Labels"
ManageIQ::Release::UpdateLabels.new(repo.github_repo, opts).run
puts "\n** Updating Travis Settings"
ManageIQ::Release::UpdateTravisSettings.new(repo.github_repo, opts.merge(:branch => "master")).run
puts "\n** Reserve rubygems entry"
ManageIQ::Release::RubygemsStub.new(repo.name, opts).run

Expand All @@ -39,7 +37,5 @@
puts
puts "******* MANUAL THINGS *******"
puts "- https://codeclimate.com/github/#{repo.github_repo} => Repo Settings => GitHub => Pull Request Status Updates => Install"
puts "- https://hakiri.io and follow the new project."
puts "- https://gitter.im/ManageIQ#createroom and create a new room linked to the repository"
puts "- Add repo to https://github.com/ManageIQ/manageiq-release/blob/master/config/repos.yml"
puts "- Add repo to the bot"
15 changes: 0 additions & 15 deletions bin/update_travis_settings.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/manageiq/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
require 'manageiq/release/update_labels'
require 'manageiq/release/update_milestone'
require 'manageiq/release/update_repo_settings'
require 'manageiq/release/update_travis_settings'

module ManageIQ
module Release
Expand Down
32 changes: 9 additions & 23 deletions lib/manageiq/release/code_climate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ def self.api_token=(token)
end

def self.badge_name
"Maintainability"
"Code Climate"
end

def self.badge_details(repo, token)
def self.badge_details(repo)
{
"description" => badge_name,
"image" => "https://api.codeclimate.com/v1/badges/#{token}/maintainability",
"url" => "https://codeclimate.com/github/#{repo.github_repo}/maintainability"
"image" => "https://codeclimate.com/github/#{repo.github_repo}.svg",
"url" => "https://codeclimate.com/github/#{repo.github_repo}"
}
end

def self.coverage_badge_name
"Test Coverage"
end

def self.coverage_badge_details(repo, token)
def self.coverage_badge_details(repo)
{
"description" => coverage_badge_name,
"image" => "https://api.codeclimate.com/v1/badges/#{token}/test_coverage",
"url" => "https://codeclimate.com/github/#{repo.github_repo}/test_coverage"
"image" => "https://codeclimate.com/github/#{repo.github_repo}/badges/coverage.svg",
"url" => "https://codeclimate.com/github/#{repo.github_repo}/coverage"
}
end

Expand All @@ -54,26 +54,12 @@ def enable
ensure_enabled
end

def badge_token
ensure_enabled
@response.fetch_path("data", 0, "attributes", "badge_token")
end

def badge_details
self.class.badge_details(repo, badge_token)
self.class.badge_details(repo)
end

def coverage_badge_details
self.class.coverage_badge_details(repo, badge_token)
end

def test_reporter_id
ensure_enabled
@response.fetch_path("data", 0, "attributes", "test_reporter_id")
end

def set_travis_test_reporter_id
Travis.new(repo, dry_run: dry_run).set_env("CC_TEST_REPORTER_ID" => test_reporter_id)
self.class.coverage_badge_details(repo)
end

private
Expand Down
37 changes: 0 additions & 37 deletions lib/manageiq/release/update_travis_settings.rb

This file was deleted.

8 changes: 1 addition & 7 deletions scripts/pull_request_blaster_outer/new_plugin_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@
travis = ManageIQ::Release::Travis.new(repo, opts)
code_climate = ManageIQ::Release::CodeClimate.new(repo, opts)

puts "\n** Enabling Travis..."
travis.enable
puts "\n** Enabling CodeClimate..."
code_climate.enable
puts "\n** Enabling Travis / CodeClimate test reporter integration..."
code_climate.set_travis_test_reporter_id

puts "\n** Updating README.md for CodeClimate badges..."
b = readme.badges.detect do |b|
b["description"] == ManageIQ::Release::CodeClimate.badge_name || b["description"] == "Code Climate"
end
b = readme.badges.detect { |b| b["description"] == ManageIQ::Release::CodeClimate.badge_name || b["description"] == "Maintainability" }
if b
b.update(code_climate.badge_details)
else
Expand Down

0 comments on commit 62628fb

Please sign in to comment.