Permalink
Browse files

Merge "`bosh releases` shows which releases are in use"

  • Loading branch information...
2 parents 4566ce0 + 4b39d23 commit c1a19e410e6a21d1b28f26195fcd7fb14efdb393 @oppegard oppegard committed with Gerrit Code Review Oct 12, 2012
Showing with 176 additions and 102 deletions.
  1. +4 −3 cli/lib/cli/commands/release.rb
  2. +8 −1 director/lib/director.rb
  3. +162 −97 director/spec/functional/director_controller_spec.rb
  4. +2 −1 spec/cli_spec.rb
@@ -152,16 +152,17 @@ def list
releases_table = table do |t|
t.headings = "Name", "Versions"
releases.each do |r|
- versions = r["versions"].sort do |v1, v2|
+ versions = r["versions"].sort { |v1, v2|
version_cmp(v1, v2)
- end
+ }.map { |v| ((r["in_use"] || []).include?(v)) ? "#{v}*" : v }
t << [r["name"], versions.join(", ")]
end
end
nl
say(releases_table)
+ say("(*) Currently deployed")
nl
say("Releases total: %d" % releases.size)
end
@@ -521,4 +522,4 @@ def match_remote_packages(manifest_yaml)
exit(1) unless confirmed?
end
end
-end
+end
View
@@ -249,9 +249,16 @@ def task_timeout?(task)
get "/releases" do
releases = Models::Release.order_by(:name.asc).map do |release|
+ versions_in_use = []
+ versions = release.versions_dataset.order_by(:version.asc).map do |rv|
+ versions_in_use << rv.version.to_s unless rv.deployments.empty?
+ rv.version.to_s
+ end
+
{
"name" => release.name,
- "versions" => release.versions_dataset.order_by(:version.asc).all.map { |rv| rv.version.to_s }
+ "versions" => versions,
+ "in_use" => versions_in_use
}
end
Oops, something went wrong.

0 comments on commit c1a19e4

Please sign in to comment.