standup 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.12
1
+ 0.3.13
data/scripts/shell.rb CHANGED
@@ -7,8 +7,15 @@ Standup.script :node do
7
7
 
8
8
  def make_shell shell_command = ''
9
9
  return unless instance
10
- command = "#{node.ssh_string} -t '#{shell_command}'"
10
+ command = "#{ssh_string} -t '#{shell_command}'"
11
11
  bright_p command
12
12
  Kernel.exec command
13
13
  end
14
+
15
+ protected
16
+
17
+ def ssh_string
18
+ return '' unless instance
19
+ "ssh -i #{Standup::Settings.aws.keypair_file} #{params.extra_options} #{scripts.ec2.params.ssh_user}@#{instance.external_ip}"
20
+ end
14
21
  end
data/scripts/webapp.rb CHANGED
@@ -7,29 +7,30 @@ Standup.script :node do
7
7
  def run
8
8
  install_package 'git-core'
9
9
  install_gem 'bundler'
10
-
10
+ install_package params.additional_packages if params.additional_packages.present?
11
+
11
12
  unless file_exists? scripts.webapp.app_path
12
13
  sudo "mkdir -p #{scripts.webapp.app_path}"
13
14
  end
14
-
15
+
15
16
  sudo "chown -R ubuntu:ubuntu #{scripts.webapp.app_path}"
16
-
17
+
17
18
  ensure_github_access
18
-
19
+
19
20
  unless file_exists? "#{scripts.webapp.app_path}/.git"
20
21
  exec "rm -rf #{scripts.webapp.app_path}/*"
21
- exec "git clone git@github.com:#{params.github_user}/#{params.github_repo}.git #{scripts.webapp.app_path}"
22
+ exec "git clone git@github.com:#{github_repo}.git #{scripts.webapp.app_path}"
22
23
  end
23
24
 
24
25
  bootstrap_db
25
26
 
26
27
  sudo "chown -R www-data:www-data #{scripts.webapp.app_path}"
27
-
28
+
28
29
  with_processed_file script_file('webapp.conf') do |file|
29
30
  scripts.passenger.add_server_conf file, "#{params.name}.conf"
30
31
  end
31
32
  end
32
-
33
+
33
34
  def app_path
34
35
  "/opt/#{params.name}"
35
36
  end
@@ -48,20 +49,20 @@ Standup.script :node do
48
49
 
49
50
  def ensure_github_access
50
51
  return unless exec('ssh -o StrictHostKeyChecking=no git@github.com') =~ /Permission denied \(publickey\)/
51
-
52
+
52
53
  unless file_exists? '~/.ssh/id_rsa'
53
54
  exec "ssh-keygen -t rsa -f ~/.ssh/id_rsa -P '' -C `hostname`"
54
55
  end
55
-
56
+
56
57
  password = bright_ask("Enter GitGub password for user #{params.github_user}:", false)
57
-
58
+
58
59
  github_add_deploy_key params.github_user,
59
60
  password,
60
- params.github_repo,
61
+ github_repo,
61
62
  exec('hostname').strip,
62
63
  exec('cat ~/.ssh/id_rsa.pub').strip
63
64
  end
64
-
65
+
65
66
  def bootstrap_db
66
67
  if db.create_database db_name
67
68
  in_dir scripts.webapp.app_path do
@@ -71,11 +72,15 @@ Standup.script :node do
71
72
  end
72
73
  end
73
74
  end
74
-
75
+
76
+ def github_repo
77
+ params.github_repo.include?('/') ? params.github_repo : "#{params.github_user}/#{params.github_repo}"
78
+ end
79
+
75
80
  def github_add_deploy_key user, password, repo, title, key
76
81
  require 'net/http'
77
82
  Net::HTTP.start 'github.com' do |http|
78
- req = Net::HTTP::Post.new "/api/v2/json/repos/key/#{user}/#{repo}/add"
83
+ req = Net::HTTP::Post.new "/api/v2/json/repos/key/#{repo}/add"
79
84
  req.form_data = {'title' => title, 'key' => key}
80
85
  req.basic_auth user, password
81
86
  response = http.request req
data/standup.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{standup}
8
- s.version = "0.3.12"
8
+ s.version = "0.3.13"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ilia Ablamonov", "Artem Orlov", "Cloud Castle Inc."]
12
- s.date = %q{2010-12-20}
12
+ s.date = %q{2010-12-21}
13
13
  s.default_executable = %q{standup}
14
14
  s.email = %q{ilia@flamefork.ru}
15
15
  s.executables = ["standup"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standup
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 12
10
- version: 0.3.12
9
+ - 13
10
+ version: 0.3.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ilia Ablamonov
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-12-20 00:00:00 +03:00
20
+ date: 2010-12-21 00:00:00 +03:00
21
21
  default_executable: standup
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency