Created
August 3, 2011 20:45
-
-
Save jgoulah/1123716 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| diff --git a/.gitignore b/.gitignore | |
| index 908d8be..b732476 100644 | |
| --- a/.gitignore | |
| +++ b/.gitignore | |
| @@ -9,3 +9,4 @@ run_logs/current* | |
| .bundle/ | |
| vendor/bundle | |
| .yardoc | |
| +.DS_Store | |
| diff --git a/templates/generic_single_push.mustache b/templates/generic_single_push.mustache | |
| index bacf33e..6ba3aae 100644 | |
| --- a/templates/generic_single_push.mustache | |
| +++ b/templates/generic_single_push.mustache | |
| @@ -2,32 +2,38 @@ | |
| <section id="info-bar" class="clearfix"> | |
| <ul> | |
| <li class="heading">Version: </li> | |
| - <li>Production – <span class="{{stack}}_production_version">{{production_version}}</span> </li> | |
| + {{#environments}} | |
| + <li>{{name}} – <span class="{{stack}}_{{name}}_version">{{current_version}}</span> </li> | |
| + {{/environments}} | |
| </ul> | |
| </section> | |
| - | |
| <aside class="pushers"> | |
| + | |
| +{{#environments}} | |
| <div class="stack-box"> | |
| - <h2><span>01.</span>Deploy {{stack}}</h2> | |
| - <form action="/dispatch" method="post" class="PRODUCTION"> | |
| - <input type="hidden" name="method" value="{{stack}}_rsync"> | |
| + <h2><span>01.</span>Deploy {{name}}</h2> | |
| + <form action="/dispatch" method="post"> | |
| + <input type="hidden" name="method" value="{{method}}"> | |
| <input type="hidden" name="stack" value="{{stack}}"> | |
| <p class="stack-status"> | |
| - <a href="/diff/{{stack}}/{{production_build}}/{{head_build}}" target="_blank"> | |
| - <span class="{{stack}}_production_build">{{production_build}}</span> | |
| + <a href="/diff/{{stack}}/{{current_version}}/{{next_build}}" target="_blank"> | |
| + <span class="{{stack}}_{{name}}_current_build">{{current_build}}</span> | |
| → | |
| - <span class="{{stack}}_head_build">{{head_build}}</span> | |
| + <span class="{{stack}}_{{name}}_next_build">{{next_build}}</span> | |
| </a> | |
| </p> | |
| {{#message_box?}} | |
| <p class="form"><label for="msg">Message:</label></p> | |
| <p class="form"><input type="text" name="msg" value="" class="textfield" id="msg"></p> | |
| {{/message_box?}} | |
| - <p class="stack-push"><button class="button {{#disabled}} button-disabled" disabled="disabled{{/disabled}}" type="submit">Deploy {{stack}}</button></p> | |
| + <p class="stack-push"><button class="button {{#disabled}} button-disabled" disabled="disabled{{/disabled}}" type="submit">Deploy {{name}}</button></p> | |
| </form> | |
| </div> | |
| +{{/environments}} | |
| + | |
| + | |
| </aside> | |
| <section id="main" class="info"> | |
| @@ -44,4 +50,4 @@ | |
| {{< log }} | |
| </div> | |
| -</section> | |
| \ No newline at end of file | |
| +</section> | |
| diff --git a/views/view_helpers.rb b/views/view_helpers.rb | |
| index 44abd08..b6be055 100644 | |
| --- a/views/view_helpers.rb | |
| +++ b/views/view_helpers.rb | |
| @@ -59,6 +59,21 @@ module Deployinator | |
| return "" if @local | |
| `ssh #{Deployinator.irc_log_host} cat /tmp/#{channel}.topic`.chomp | |
| end | |
| + | |
| + def environments | |
| + custom_env = "#{stack}_environments" | |
| + return send(custom_env) if respond_to?(custom_env.to_sym) | |
| + [ | |
| + { | |
| + :name => "production", | |
| + :method => "#{stack}_rsync", | |
| + :current_version => proc{send(:"#{stack}_production_version")}, | |
| + :current_build => proc{Version.get_build(send(:"#{stack}_production_version"))}, | |
| + :head_build => proc{send(:"#{stack}_head_build")} | |
| + } | |
| + ] | |
| + end | |
| + | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment