Changeset 82
- Timestamp:
- 02/11/08 18:22:38 (9 months ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
app/controllers/stages_controller.rb (modified) (1 diff)
-
app/models/stage.rb (modified) (1 diff)
-
app/views/stages/show.html.erb (modified) (1 diff)
-
app/views/stages/tasks.html.erb (modified) (2 diffs)
-
test/unit/webistrano_deployer_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/stages_controller.rb
r79 r82 7 7 def show 8 8 @stage = current_project.stages.find(params[:id]) 9 @task_list = [['All tasks: ', '']] + @stage.list_tasks.collect{|x| [x.first, x.first]}.sort 9 10 10 11 respond_to do |format| -
trunk/app/models/stage.rb
r51 r82 124 124 d.stage = self 125 125 deployer = Webistrano::Deployer.new(d) 126 deployer.list_tasks.collect { |t| [t.fully_qualified_name, t.description] } 126 deployer.list_tasks.collect { |t| [t.fully_qualified_name, t.description] }.delete_if{|x| x.first == 'shell' || x.first == 'invoke'} 127 127 end 128 128 -
trunk/app/views/stages/show.html.erb
r73 r82 3 3 4 4 <div class="special_box deployments_box"> 5 <p><%= link_to 'Deploy', new_project_stage_deployment_path(current_project, @stage) + '?task=deploy', :class => 'arrow_link _big' %></p>5 <p><%= link_to 'Deploy', new_project_stage_deployment_path(current_project, @stage) + '?task=deploy', :class => 'arrow_link' %></p> 6 6 <p><%= link_to 'Deploy and migrate', new_project_stage_deployment_path(current_project, @stage) + '?task=deploy:migrations', :class => 'arrow_link' %></p> 7 7 <p><%= link_to 'Restart App Servers', new_project_stage_deployment_path(current_project, @stage) + '?task=deploy:restart', :class => 'arrow_link' %></p> 8 <p><%= link_to 'Rollback to previous', new_project_stage_deployment_path(current_project, @stage) + '?task=deploy:rollback', :class => 'arrow_link' %></p>9 8 <p><%= link_to 'Setup', new_project_stage_deployment_path(current_project, @stage) + '?task=deploy:setup', :class => 'arrow_link' %></p> 10 <p><%= link_to 'List all available tasks', tasks_project_stage_path(current_project, @stage), :class => 'arrow_link' %></p> 9 <p> 10 <%= select_tag('task', options_for_select(@task_list)) %> 11 </p> 12 <p> 13 <%= link_to 'Execute', new_project_stage_deployment_path(current_project, @stage), :class => 'arrow_link', 14 :onclick => "location.href='#{new_project_stage_deployment_path(current_project, @stage)}?task=' + $F('task'); return false" %> | 15 <%= link_to 'Info', tasks_project_stage_path(current_project, @stage), :class => 'arrow_link', 16 :onclick => "location.href='#{tasks_project_stage_path(current_project, @stage)}#' + $F('task'); return false" %> 17 </p> 11 18 </div> 12 19 -
trunk/app/views/stages/tasks.html.erb
r73 r82 6 6 <% @tasks.sort.each do |key, value| %> 7 7 <tr> 8 <td valign="top"><%= link_to key, new_project_stage_deployment_path(current_project, @stage) + "?task=#{key}"%></td> 9 <td valign="top"><%= simple_format value %></td> 8 <td valign="top"><%= link_to key, new_project_stage_deployment_path(current_project, @stage) + "?task=#{key}", :class => 'arrow_link', :name => h(key)%></td> 9 <td> </td> 10 <td valign="top"><%= simple_format value %></td> 10 11 </tr> 11 12 <% end %> … … 13 14 14 15 </fieldset> 16 17 <br /> 18 <%= link_to 'Back', project_stage_path(@project, @stage), :class => 'arrow_link' %> -
trunk/test/unit/webistrano_deployer_test.rb
r34 r82 681 681 assert_not_nil deployer.list_tasks 682 682 assert_equal 23, deployer.list_tasks.size 683 assert_equal 2 3, @stage.list_tasks.size683 assert_equal 21, @stage.list_tasks.size # filter shell and invoke 684 684 deployer.list_tasks.each{|t| assert t.is_a?(Capistrano::TaskDefinition) } 685 685 … … 696 696 697 697 assert_equal 24, deployer.list_tasks.size 698 assert_equal 2 4, @stage.list_tasks.size698 assert_equal 22, @stage.list_tasks.size # filter shell and invoke 699 699 assert_equal 1, deployer.list_tasks.delete_if{|t| t.fully_qualified_name != 'foo:bar'}.size 700 700 assert_equal 1, @stage.list_tasks.delete_if{|t| t[0] != 'foo:bar'}.size
