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: 513a67755a3df6d235fb41755112319a01c96cde
4
- data.tar.gz: c9a91b250af577eec8d57b9fd630dd8bddf5a58c
3
+ metadata.gz: db28dc3cca93e0f69726e5bc07371cb42dcc9906
4
+ data.tar.gz: b41605f372dc52153c7f79613a9af1f89368f003
5
5
  SHA512:
6
- metadata.gz: 8773c5bdd037ab648c3abab5372204b2147e6bfdade3cf279efc4d946a2ef399711eeebbbd482b21c29d6027081f593b13c7aaba4eaa3be8974659bddcc33b40
7
- data.tar.gz: 10e71da137982081fdd208c85cdd0f11b2c31571541f888b41d5ac963d31d23e0d3e771f49ca51ad7cae1248f5356a7156af636af73fd7b1ba8679c6e12fab41
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,8 @@
1
+ namespace :deploy do
2
+ task :prepare_nginx do
3
+ on roles(:app) do
4
+ execute :sudo, :rm, '/etc/nginx/sites-enabled/default'
5
+ execute :sudo, '/etc/init.d/nginx restart'
6
+ end
7
+ end
8
+ end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Teleporter
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
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.1
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-22 00:00:00.000000000 Z
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