FEATURE: rake plugin:install_all_official
use this task to quickly install all official plugins GIT_WRITE=1 to enable write access to repos (discourse staff only)
This commit is contained in:
parent
38daa61fc7
commit
b92e181390
|
@ -25,7 +25,13 @@ class Plugin::Metadata
|
||||||
"poll",
|
"poll",
|
||||||
"discourse-plugin-linkedin-auth",
|
"discourse-plugin-linkedin-auth",
|
||||||
"discourse-plugin-office365-auth",
|
"discourse-plugin-office365-auth",
|
||||||
"discourse-oauth2-basic"
|
"discourse-oauth2-basic",
|
||||||
|
"discourse-math",
|
||||||
|
"discourse-bbcode-color",
|
||||||
|
"discourse-bbcode",
|
||||||
|
"discourse-affiliate",
|
||||||
|
"discourse-translator",
|
||||||
|
"discourse-patreon"
|
||||||
])
|
])
|
||||||
|
|
||||||
FIELDS ||= [:name, :about, :version, :authors, :url, :required_version]
|
FIELDS ||= [:name, :about, :version, :authors, :url, :required_version]
|
||||||
|
|
|
@ -1,5 +1,47 @@
|
||||||
directory 'plugins'
|
directory 'plugins'
|
||||||
|
|
||||||
|
desc 'install all official plugins'
|
||||||
|
task 'plugin:install_all_official' do
|
||||||
|
skip = Set.new([
|
||||||
|
'customer-flair',
|
||||||
|
'discourse-nginx-performance-report',
|
||||||
|
'hosted-site',
|
||||||
|
'lazyYT',
|
||||||
|
'poll',
|
||||||
|
])
|
||||||
|
|
||||||
|
map = {
|
||||||
|
'Canned Replies' => 'https://github.com/discourse/discourse-canned-replies',
|
||||||
|
'Spoiler Alert!' => 'https://github.com/discourse/discourse-spoiler-alert',
|
||||||
|
'staff-notes' => 'https://github.com/discourse/discourse-staff-notes',
|
||||||
|
'GitHub badges' => 'https://github.com/discourse/github_badges',
|
||||||
|
}
|
||||||
|
|
||||||
|
#require 'plugin/metadata'
|
||||||
|
Plugin::Metadata::OFFICIAL_PLUGINS.each do |name|
|
||||||
|
next if skip.include? name
|
||||||
|
repo = map[name] || "https://github.com/discourse/#{name}"
|
||||||
|
dir = repo.split('/').last
|
||||||
|
path = File.expand_path('plugins/' + dir)
|
||||||
|
|
||||||
|
if Dir.exist? path
|
||||||
|
STDERR.puts "Skipping #{dir} cause it already exists!"
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
|
if ENV['GIT_WRITE']
|
||||||
|
STDERR.puts "Allowing write to all repos!"
|
||||||
|
repo.gsub!("https://github.com/", "git@github.com:")
|
||||||
|
repo << ".git"
|
||||||
|
end
|
||||||
|
|
||||||
|
status = system("git clone #{repo} #{path}")
|
||||||
|
unless status
|
||||||
|
abort("Failed to clone #{repo}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
desc 'install plugin'
|
desc 'install plugin'
|
||||||
task 'plugin:install', :repo do |t, args|
|
task 'plugin:install', :repo do |t, args|
|
||||||
repo = ENV['REPO'] || ENV['repo'] || args[:repo]
|
repo = ENV['REPO'] || ENV['repo'] || args[:repo]
|
||||||
|
|
Loading…
Reference in New Issue