flash_kick 0.1.1 → 0.1.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: 75f309f0d603a93c56c314c15e2ed7d8c0472a7b
4
- data.tar.gz: 2c4fd7afa53498821df604c63cd81da11416ed0c
3
+ metadata.gz: d26c79471f38ee87db2bec3251dfd308da44ad3f
4
+ data.tar.gz: 3c77f0c7410a01c365006ea27ab50a501b23a9ee
5
5
  SHA512:
6
- metadata.gz: 7eead790b1e9f2e8eb3f2e8ff885f52f05553f7431b57fb368595682326c117b0dd8df01e6c0bac31dcb94352a8c0c9a4ebc22569b8ee035833fb0801beb75cc
7
- data.tar.gz: 3155bb461a203714081d46da70451755ae1b01cd634fdb67d6712ac069af10ab3fd7200d93e08c6fbdae9eaa23f16cccfc91c602c5a22dd9e2149b2afc14b389
6
+ metadata.gz: 986a80f2819cfd16c6016f3af497a84b011ee05938aa9fb865403feaf7191715d1b3618c88709913f6084fce7960c5af0f63eca27450199f3ab7667c3dd901a6
7
+ data.tar.gz: 1ae3f6e55a48596ecfed5b7555ec886fbcb9db8a42e5e17978b61ae815e92861a88297f2e3139a862eeaa1b730368b445163b0be4d790566552cc1c3a43da2d5
@@ -1,3 +1,3 @@
1
1
  module FlashKick
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -22,8 +22,8 @@ module FlashKick
22
22
  end
23
23
  question :string do
24
24
  {
25
- server_user: 'Enter a name for your server user',
26
- required: true
25
+ server_user: 'Enter a name for your server deployer user',
26
+ default: 'deploy'
27
27
  }
28
28
  end
29
29
  question :string do
@@ -35,13 +35,13 @@ module FlashKick
35
35
  question :string do
36
36
  {
37
37
  ruby_version: 'Which version of Ruby would you like to install? [enter for default]',
38
- default: '2.1.5'
38
+ default: '2.3.0'
39
39
  }
40
40
  end
41
41
  question :string do
42
42
  {
43
43
  postgresql_version: 'Which version of PostgreSQL would you like to install? [enter for default]',
44
- default: '9.3'
44
+ default: '9.5'
45
45
  }
46
46
  end
47
47
  question :string do
@@ -53,7 +53,7 @@ module FlashKick
53
53
  question :string do
54
54
  {
55
55
  database_user: 'Enter a name for your production database user',
56
- required: true
56
+ default: 'postgres'
57
57
  }
58
58
  end
59
59
  question :string do
@@ -6,6 +6,8 @@ module FlashKick
6
6
 
7
7
  cattr_accessor :required
8
8
 
9
+ @shell ||= Thor::Shell::Color.new
10
+
9
11
  def self.question(type, &block)
10
12
  question_hash = block.call
11
13
  @@required = question_hash[:required]
@@ -29,7 +31,7 @@ module FlashKick
29
31
  until answer != ''
30
32
  answer = Thor.new.ask(question)
31
33
  FlashKick::VariableStore.add_variable(key, answer.empty? ? default : answer)
32
- puts "Answer required, but you can always change it later!!!\n\n" if answer == ''
34
+ @shell.say("Answer required, but you can always change it later!!!\n\n", :yellow) if answer == ''
33
35
  end
34
36
  else
35
37
  answer = Thor.new.ask(question)
@@ -44,7 +46,7 @@ module FlashKick
44
46
 
45
47
  def self.question_divider(value=nil)
46
48
  puts '-' * 100
47
- puts "Default: #{value}" unless value.nil?
49
+ @shell.say("Default: #{value}", :green) unless value.nil?
48
50
  end
49
51
  end
50
52
  end
@@ -6,11 +6,11 @@ require 'yaml'
6
6
 
7
7
  FLASH = YAML.load(File.read(File.expand_path('../../.env/production_env.yml', __FILE__)))
8
8
 
9
- set :deploy_to, FLASH['app_name']
10
- set :app_path, FLASH['app_name']
9
+ set :deploy_to, FLASH['app_root']
11
10
  set :user, FLASH['server_user']
12
11
  set :port, FLASH['server_ssh_port']
13
12
  set :repository, FLASH['app_repo']
13
+ set :rails_env, FLASH['rails_env']
14
14
  set :forward_agent, true
15
15
 
16
16
  task :production do
@@ -49,14 +49,14 @@ end
49
49
 
50
50
  namespace :server do
51
51
  task start: :environment do
52
- queue "cd #{app_path} && rails_env=#{rails_env} && bin/puma.sh start"
52
+ queue "cd $APP_ROOT/current && rails_env=#{rails_env} && bin/puma.sh start"
53
53
  end
54
54
 
55
55
  task stop: :environment do
56
- queue "cd #{app_path} && rails_env=#{rails_env} && bin/puma.sh stop"
56
+ queue "cd $APP_ROOT/current && rails_env=#{rails_env} && bin/puma.sh stop"
57
57
  end
58
58
 
59
59
  task restart: :environment do
60
- queue "cd #{app_path} && rails_env=#{rails_env} && bin/puma.sh restart"
60
+ queue "cd $APP_ROOT/current && rails_env=#{rails_env} && bin/puma.sh restart"
61
61
  end
62
62
  end
@@ -2,6 +2,9 @@
2
2
  - name: add keyscan to allow basic access to github
3
3
  shell: ssh-keyscan github.com >> /etc/ssh/ssh_known_hosts
4
4
 
5
+ - name: add keyscan to allow basic access to Bitbucket
6
+ shell: ssh-keyscan bitbucket.org >> /etc/ssh/ssh_known_hosts
7
+
5
8
  - name: install basic packages
6
9
  apt: pkg={{item}} state=present update_cache=yes
7
10
  with_items:
@@ -13,7 +13,12 @@
13
13
  apt_repository: repo="deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_lsb.codename}}-pgdg main"
14
14
 
15
15
  - name: install postgres
16
- apt: name=postgresql-{{postgresql_version}} state=latest update_cache=true
16
+ become: true
17
+ apt:
18
+ name: "postgresql-{{postgresql_version}}"
19
+ state: present
20
+ update_cache: yes
21
+ cache_valid_time: 3600
17
22
 
18
23
  - name: copy pg_hba.conf
19
24
  become: true
@@ -26,6 +31,13 @@
26
31
  - name: start postgresql
27
32
  service: name=postgresql state=started
28
33
 
34
+ - name: Install PostgreSQL contribs
35
+ become: true
36
+ apt:
37
+ name: "postgresql-contrib-{{postgresql_version}}"
38
+ notify: restart postgresql
39
+
40
+
29
41
  - name: create db user
30
42
  postgresql_user: name={{database_user}} password={{database_password}} role_attr_flags=CREATEDB
31
43
  become_user: postgres
@@ -18,6 +18,10 @@
18
18
  - 'export APP_NAME={{app_name}}'
19
19
  - 'export APP_ROOT={{app_root}}'
20
20
  - 'export RAILS_ENV={{rails_env}}'
21
+ - 'export DATABASE_NAME={{database_name}}'
22
+ - 'export DATABASE_USER={{database_user}}'
23
+ - 'export DATABASE_PASSWORD={{database_password}}'
24
+ - 'export SECRET_KEY_BASE={{secret_key_base}}'
21
25
 
22
26
  - name: source .session_vars from .bashrc
23
27
  lineinfile: dest=/home/{{server_user}}/.bashrc insertafter=EOF line='source ~/.session_vars'
@@ -1,3 +1,3 @@
1
1
  [production]
2
- root ansible_ssh_host=<%= FlashKick::VariableStore.variables['server_domain'] == '' ? '127.0.0.1' : {{server_domain}} %>
3
- deploy ansible_ssh_host=<%= FlashKick::VariableStore.variables['server_domain'] == '' ? '127.0.0.1' : {{server_domain}} %> ansible_ssh_port=<%= FlashKick::VariableStore.variables['server_ssh_port'] == '' ? '22' : FlashKick::VariableStore.variables['server_ssh_port'] %>
2
+ root ansible_ssh_host={{server_domain}}
3
+ deploy ansible_ssh_host={{server_domain}} ansible_ssh_port=<%= FlashKick::VariableStore.variables['server_ssh_port'] == '' ? '22' : FlashKick::VariableStore.variables['server_ssh_port'] %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash_kick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Helio Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-15 00:00:00.000000000 Z
11
+ date: 2016-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubyforge_project:
141
- rubygems_version: 2.4.5.1
141
+ rubygems_version: 2.5.1
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Quick and painless Rails deployment