mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 11:25:24 +00:00
DEV: Show plugin versions in CI
This commit is contained in:
parent
90eeb8f7d9
commit
a3580fa292
@ -68,6 +68,7 @@ task 'plugin:update_all' do |t|
|
||||
Rake::Task['plugin:update'].invoke(plugin)
|
||||
Rake::Task['plugin:update'].reenable
|
||||
end
|
||||
Rake::Task['plugin:versions'].invoke
|
||||
end
|
||||
|
||||
desc 'update a plugin'
|
||||
@ -214,3 +215,24 @@ namespace 'plugin:migrate' do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc 'display all plugin versions'
|
||||
task 'plugin:versions' do |t, args|
|
||||
versions =
|
||||
Dir
|
||||
.glob('*', base: 'plugins')
|
||||
.map { |plugin|
|
||||
[plugin, "plugins/#{plugin}", "plugins/#{plugin}/.git"]
|
||||
}
|
||||
.select { |plugin, plugin_dir, plugin_git_dir|
|
||||
File.directory?(plugin_dir) && File.directory?(plugin_git_dir)
|
||||
}
|
||||
.map { |plugin, _, plugin_git_dir|
|
||||
version = `git --git-dir \"#{plugin_git_dir}\" rev-parse HEAD`
|
||||
abort("unable to get #{plugin} version") unless version
|
||||
[plugin, version.strip[0...8]]
|
||||
}
|
||||
.to_h
|
||||
|
||||
puts JSON.pretty_generate(versions)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user