Skip to content

Commit

Permalink
readying for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
burnto committed Sep 24, 2009
1 parent 8a01017 commit 5e327a7
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 280 deletions.
3 changes: 3 additions & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
7 changes: 7 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

def piece_image_tag piece, size=300
content_tag "div", :class => "piece" do
image_tag "/os/#{size}/#{piece.legacy_id}.png"
end
end

end
26 changes: 26 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>OPENSTUDIO Archives</title>

<style type="text/css" media="screen">
h2 {
clear: both;
}

.gallery {
width: 100%;
overflow: auto;
margin-bottom: 20px;
}

.gallery .piece {
width: 300px;
height: 300px;
overflow: hidden;
float: left;
border: 1px solid #ccc;
margin: 10px;
}

img {
border: none;
}

</style>
</head>

<body>
Expand Down
8 changes: 6 additions & 2 deletions app/views/members/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
<p>(<%= @member.login %>)</p>

<h2>Purchased</h2>
<div class="gallery">
<% @member.owned.sold.each do |piece| %>
<%= link_to h(piece.title), piece_path(piece) %>
<%= link_to piece_image_tag(piece), piece_path(piece) %>
<% end %>
</div>

<h2>Portfolio</h2>
<div class="gallery">
<% @member.created.each do |piece| %>
<%= link_to h(piece.title), piece_path(piece) %>
<%= link_to piece_image_tag(piece), piece_path(piece) %>
<% end %>
</div>
6 changes: 3 additions & 3 deletions app/views/pieces/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<h1><%= @piece.title %></h1>

<div>
<%= image_tag "/os/500/#{@piece.legacy_id}.png" %>
<%= piece_image_tag @piece, 640 %>
</div>

<p>
Creator: <%= link_to h(@piece.creator.name), member_path(@piece.creator) %>
Owner: <%= link_to h(@piece.owner.name), member_path(@piece.owner) %>
</p>

<p>
Owner: <%= link_to h(@piece.owner.name), member_path(@piece.owner) %>
Created by <%= link_to h(@piece.creator.name), member_path(@piece.creator) %> <%= @piece.created_at.to_formatted_s(:long) %>.<br/> Last modified <%= @piece.updated_at.to_formatted_s(:long) %>
</p>

41 changes: 41 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# The host where people will access my site
set :application, "openstudio.tacolab.com"
set :user, "openstudio"
set :admin_login, "openstudio"

# repo info
set :repository, "[email protected]:burnto/OPENSTUDIO-archive.git"
set :scm, "git"
set :branch, "master"

set :deploy_to, "/home/#{admin_login}/#{application}"

# My DreamHost-assigned server
set :domain, "#{application}"
role :app, domain
role :web, domain
role :db, domain, :primary => true

set :use_sudo, false
# set :checkout, "export"
set :scm_verbose, true
set :repository_cache, "git_cache"
set :deploy_via, :remote_cache

# additional settings
default_run_options[:pty] = true # Forgo errors when deploying from windows
#ssh_options[:keys] = %w(/Path/To/id_rsa) # If you are using ssh_keys
set :chmod755, "app config db lib public vendor script script/* public/disp*"

#############################################################
# Passenger
#############################################################

namespace :passenger do
desc "Restart Application"
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end

after :deploy, "passenger:restart"
Loading

0 comments on commit 5e327a7

Please sign in to comment.