teleporter 1.2.1 → 1.2.2
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db28dc3cca93e0f69726e5bc07371cb42dcc9906
|
4
|
+
data.tar.gz: b41605f372dc52153c7f79613a9af1f89368f003
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1ede881c35d934eae8585bae7f62c838370306dc3eeba3303678f5a79942038c79f4071ef5b8348216667c187941902024423ea1fcb867eb3d15751b9eb315f
|
7
|
+
data.tar.gz: 46ceaf765aacba3c2b4f004b20aa9d2d12f1295daa240dd3f8e3b69826ee78055bb13c2a043d16c07fe93fcb837d37feafcc4d24fc452cd992264161b99c738b
|
data/README.md
CHANGED
@@ -55,6 +55,7 @@ generates `WelcomeController#index` and uses it as `root_path`
|
|
55
55
|
### rails g initial:capistrano
|
56
56
|
adds gems: `capistrano`, `capistrano-rbenv`, `capistrano-bundler`, `capistrano-rails`, `capistrano-sidekiq`, `capistrano-puma`
|
57
57
|
generate Capistrano 3 configs for deployment
|
58
|
+
add tasks
|
58
59
|
|
59
60
|
### rails g initial:bootstrap
|
60
61
|
adds gems `bootstrap-sass`, `kaminari-bootstrap`, `bh`, `autoprefixer-rails`
|
@@ -0,0 +1,57 @@
|
|
1
|
+
namespace :deploy do
|
2
|
+
task :setup_db do
|
3
|
+
|
4
|
+
on roles(:app) do
|
5
|
+
db_adapter = ask1 %Q{ Choose database adapter:
|
6
|
+
1. postgresql
|
7
|
+
2. mysql2 }
|
8
|
+
|
9
|
+
db_adapter = case db_adapter
|
10
|
+
when /1/
|
11
|
+
'postgresql'
|
12
|
+
when /2/
|
13
|
+
'mysql2'
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
ask(:db_password, 'Type database password:')
|
18
|
+
|
19
|
+
database_content = %Q{#{fetch(:rails_env)}
|
20
|
+
adapter: #{db_adapter}
|
21
|
+
timeout: 5000
|
22
|
+
encoding: utf8
|
23
|
+
reconnect: false
|
24
|
+
database: #{fetch(:application)}_#{fetch(:rails_env)}
|
25
|
+
pool: 5
|
26
|
+
username: #{fetch(:deploy_user)}
|
27
|
+
password: #{fetch(:db_password)}
|
28
|
+
host:
|
29
|
+
port: 5432
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
database_content = StringIO.new(database_content)
|
34
|
+
upload! database_content, "#{shared_path}/config/database.yml"
|
35
|
+
|
36
|
+
begin
|
37
|
+
execute :whoami
|
38
|
+
execute %Q{echo "CREATE ROLE #{fetch(:deploy_user)} PASSWORD '#{fetch(:db_password)}' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;" | sudo -u postgres psql}
|
39
|
+
rescue Exception
|
40
|
+
end
|
41
|
+
begin
|
42
|
+
execute :sudo, '/etc/init.d/postgresql restart'
|
43
|
+
sleep 3
|
44
|
+
rescue Exception
|
45
|
+
end
|
46
|
+
begin
|
47
|
+
execute %Q{echo "CREATE DATABASE #{fetch(:application)}_#{fetch(:rails_env)} WITH OWNER #{fetch(:deploy_user)} ENCODING 'UTF8';" | sudo -u postgres psql}
|
48
|
+
rescue Exception
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def ask1(question)
|
55
|
+
puts question
|
56
|
+
$stdin.gets.chomp
|
57
|
+
end
|
data/lib/teleporter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teleporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ponomarev Nikolay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -120,7 +120,9 @@ files:
|
|
120
120
|
- lib/generators/initial/templates/capistrano/tasks/check_revision.rake
|
121
121
|
- lib/generators/initial/templates/capistrano/tasks/compile_assets_locally.rake
|
122
122
|
- lib/generators/initial/templates/capistrano/tasks/logs.rake
|
123
|
+
- lib/generators/initial/templates/capistrano/tasks/prepare_nginx.rake
|
123
124
|
- lib/generators/initial/templates/capistrano/tasks/setup_config.rake
|
125
|
+
- lib/generators/initial/templates/capistrano/tasks/setup_db.rake
|
124
126
|
- lib/generators/initial/templates/database/database.yml
|
125
127
|
- lib/generators/initial/templates/devise/devise.ru.yml
|
126
128
|
- lib/generators/initial/templates/devise_oauth/devise_oauth.rb
|