dew 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,6 +45,7 @@ class DeployCommand < Clamp::Command
45
45
  end
46
46
 
47
47
  env = Environment.get(environment_name)
48
+ raise "Unknown environment #{environment_name}" unless env
48
49
 
49
50
  db_managed = false
50
51
 
@@ -161,6 +162,7 @@ class DeployCommand < Clamp::Command
161
162
  ssh.run "sudo a2dissite default"
162
163
  end
163
164
  Inform.debug("Uploading passenger config")
165
+ working_directory = ssh.run("cd #{application_name} && pwd").chomp
164
166
  passenger_config = ERB.new(File.read template('apache.conf.erb')).result(OpenStruct.new(
165
167
  :use_passenger? => use_passenger?,
166
168
  :use_ssl? => use_ssl?,
@@ -168,11 +170,13 @@ class DeployCommand < Clamp::Command
168
170
  :rails_env => rails_env,
169
171
  :log_dir => is_redhat ? '/var/log/httpd' : '/var/log/apache2',
170
172
  :application_name => application_name,
171
- :working_directory => "/home/ubuntu/#{application_name}",
173
+ :working_directory => working_directory,
172
174
  :gamej_proxy => gamej_proxy
173
175
  ).instance_eval {binding})
174
- ssh.write passenger_config, "/tmp/apache.conf"
175
- ssh.run "sudo cp /tmp/apache.conf #{conf_dest}"
176
+ apache_tmpfile = ssh.run("mktemp -t apacheconf").chomp
177
+ ssh.write passenger_config, apache_tmpfile
178
+ ssh.run "sudo cp #{apache_tmpfile} #{conf_dest}"
179
+ ssh.run "rm #{apache_tmpfile}"
176
180
  ssh.run "sudo chmod 0644 #{conf_dest}" # yeah, I don't know why it gets written as 0600
177
181
  unless is_redhat || ssh.exist?('/etc/apache2/sites-enabled/#{application_name}')
178
182
  Inform.debug("Enabling site in apache")
@@ -1,4 +1,4 @@
1
- <VirtualHost *:80>
1
+ <VirtualHost *:8080>
2
2
  ServerAdmin admin@playup.com
3
3
 
4
4
  <% if server_name %>
@@ -48,6 +48,7 @@
48
48
  ProxyPassReverse /api/ http://<%= server_name %>/
49
49
  <% end %>
50
50
  </VirtualHost>
51
+
51
52
  <% if use_ssl? %>
52
53
  NameVirtualHost *:443
53
54
  <VirtualHost *:443>
data/lib/dew/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dew
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dew
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.8
5
+ version: 0.1.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - PlayUp Devops
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-20 00:00:00 Z
13
+ date: 2011-07-27 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: inform