diff --git a/lib/plugin/metadata.rb b/lib/plugin/metadata.rb index bcf8954d2bd..123fccc396b 100644 --- a/lib/plugin/metadata.rb +++ b/lib/plugin/metadata.rb @@ -25,7 +25,13 @@ class Plugin::Metadata "poll", "discourse-plugin-linkedin-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] diff --git a/lib/tasks/plugin.rake b/lib/tasks/plugin.rake index acb8e5b1d7c..141c6472f38 100644 --- a/lib/tasks/plugin.rake +++ b/lib/tasks/plugin.rake @@ -1,5 +1,47 @@ 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' task 'plugin:install', :repo do |t, args| repo = ENV['REPO'] || ENV['repo'] || args[:repo]