Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from alphagov/candidate-deploy-view
Candidate deploy view
- Loading branch information
Showing
6 changed files
with
177 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<% content_for :page_title, @application.name %> | ||
|
||
<div class="page-header"> | ||
<h1 class="remove-bottom-margin"> | ||
<span class="name">Deploy <%= @application.name %></span> | ||
<span class="shortname">(<%= @application.shortname %>)</span> | ||
</h1> | ||
<%= link_to @application.repo_url, @application.repo_url, target: "_blank" %> | ||
</div> | ||
|
||
<main> | ||
<h2>Candidate Release <span class="label label-info"><%= @release_tag %></span></h2> | ||
<p class="lead add-top-margin">Production is <span class="label label-danger"><%= @production_deploy.version %></span> — deployed at <%= human_datetime(@production_deploy.created_at) %></p> | ||
|
||
<% unless @application.staging_and_production_in_sync? %> | ||
<div class="callout callout-danger"> | ||
<div class="callout-title">Production and Staging are not in sync</div> | ||
<div class="callout-body">Proceed with caution and check the <a href="<%= @application.repo_compare_url('deployed-to-production', 'deployed-to-staging') %>">differences between production and staging</a></div> | ||
</div> | ||
<% end %> | ||
|
||
<p class="pull-right"> | ||
<a class="btn btn-default" href="<%= @application.repo_compare_url(@production_deploy.version, @release_tag) %>"> | ||
<i class="glyphicon glyphicon-new-window add-right-margin"></i>Show full Commit | ||
</a> | ||
<a class="btn btn-default" href="<%= @application.repo_compare_url(@production_deploy.version, @release_tag) %>"> | ||
<i class="glyphicon glyphicon-new-window add-right-margin"></i>Full Diff | ||
</a> | ||
</p> | ||
|
||
<p class="lead"><%= @commits.length %> <%= 'commit'.pluralize(@commits.length) %></p> | ||
|
||
<% if @github_available %> | ||
<table class="table table-striped table-bordered table-hover commits" data-module="filterable-table"> | ||
<thead> | ||
<tr class="table-header"> | ||
<th width="10%">Hash</th> | ||
<th width="55%">Message</th> | ||
<th width="20%">Author</th> | ||
<th width="15%">Date</th> | ||
</tr> | ||
<tr class="if-no-js-hide table-header-secondary"> | ||
<td colspan="4"> | ||
<form> | ||
<label for="table-filter" class="rm">Filter commits</label> | ||
<input id="table-filter" type="text" class="form-control normal js-filter-table-input" placeholder="Filter commits"> | ||
</form> | ||
</td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @commits.each do |commit| %> | ||
<tr> | ||
<td class="hash"> | ||
<%= link_to commit[:sha][0..8], "#{@application.repo_url}/commit/#{commit[:sha]}", target: "_blank" %> | ||
</td> | ||
<td class="message"> | ||
<% summary, body = commit[:commit][:message].split(/\n/, 2) %> | ||
<a href="<%= "#{@application.repo_url}/commit/#{commit[:sha]}" %>" target="_blank"><%= summary %></a> | ||
</td> | ||
<td class=""> | ||
<% if commit[:commit][:author] %> | ||
<img height="20" width="20" class="avatar" src="<%= commit[:author][:avatar_url] %>" alt="" /> | ||
<span class="name"> | ||
<%= commit[:commit][:author][:name] %> | ||
</span> | ||
<% end %> | ||
</td> | ||
<td calss="date"> | ||
<% if commit[:commit][:author] %> | ||
<% commit_date = commit[:commit][:author][:date] %> | ||
<span class="date"><%= commit_date.to_date.to_s(:short) =%></span> | ||
<span class="time"><%= commit_date.to_s(:govuk_time) =%></span> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<% else %> | ||
<div class="alert alert-error"> | ||
Couldn't get data from GitHub: | ||
<br> | ||
<%= @github_error %> | ||
</div> | ||
<% end %> | ||
</table> | ||
|
||
<h2>Deploy</h2> | ||
<div class="row"> | ||
<div class="col-md-3"> | ||
<a href="https://www.flickr.com/photos/fatty/9158066939/"><img title="Obey the Badger of Deploy" src="https://farm3.staticflickr.com/2835/9158066939_374360ed56_n.jpg" alt="Obey the Badger of Deploy" width="229" height="320"></a> | ||
</div> | ||
|
||
<div class="col-md-9"> | ||
<h3>Test on Staging</h3> | ||
<p>Make sure you're using the <code>govuk_select_organisation</code> script to test against the staging environment.</p> | ||
<p><a class="btn btn-primary add-bottom-margin" href="https://deploy.staging.alphagov.co.uk/job/Staging_Deploy/parambuild?TARGET_APPLICATION=<%= @application.shortname %>&TAG=<%= @release_tag %>">Deploy to Staging</a></p> | ||
|
||
<h3>Promote to Production</h3> | ||
<p><a class="btn btn-danger" href="https://deploy.production.alphagov.co.uk/job/Production_Deploy/parambuild?TARGET_APPLICATION=<%= @application.shortname %>&TAG=<%= @release_tag %>">Deploy to Production</a></p> | ||
</div> | ||
</div> | ||
|
||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ | |
put :update_notes | ||
end | ||
|
||
member do | ||
get :deploy | ||
end | ||
|
||
resources :deployments | ||
end | ||
|
||
|