taperole 1.2.7 → 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15f77ca70380f0f66bdbf26414f405f13b0c6cbb
4
- data.tar.gz: cd5901d3a0407b69bac91b9dcc5532ad15450dc8
3
+ metadata.gz: b222a5a4cae4120e81b66cb9000fe978e757a8c1
4
+ data.tar.gz: dd1609ccb8a53d633fed08b303fe00285f2c3c5e
5
5
  SHA512:
6
- metadata.gz: 2b03cbcd931df51b9c51d68a2fdbc4fe7e1d3cd4df5fc1fce649530fbd65f8dc094f31b12fb7b18b16fc6cf525d866edac29426911ec7383a1157ae26f996734
7
- data.tar.gz: 2aa798c502d1a0c586f9df36a2b0f2c1b3e742089689c9484a1fc0433e199feb00a2af79199d2e7f0cdb13174c38c8e4a82f100a2344b44120e5b507b711f253
6
+ metadata.gz: 713a7ff37a753a09d8a0a4a449fce988360b958d437c63736e78879fc5f263a7327670949736825402f68e42a44c08d06f9d0b6bac6f9f8bcb653a30c2ff1e2f
7
+ data.tar.gz: dc899db4d9cefe5439f57a0925743449d64795599a21a74d1806eb2d5aca774ce9c75b255ba14477749b9d8c1e647531a3f1bf501746914b9894a2088d8147a4
data/README.md CHANGED
@@ -10,12 +10,23 @@
10
10
 
11
11
  **Install**
12
12
 
13
- * `gem install taperole` or `gem 'taperole'`
14
- * run `tape installer install` in project repo
15
- * Updated the hosts file with the IP address of your server
16
- * Fill in missing values in `tape_vars.yml`
17
- * Copy all developers public keys into some dir and specify that dir inside `tape_vars.yml` (dev_key_files)
18
- * `tape ansible everything`
13
+ * `$ gem install taperole` or `gem 'taperole'`
14
+ * `$ brew install ansible`
15
+ * Create a [Digital Ocean Droplet](https://www.digitalocean.com/)
16
+ * Run `tape installer install` in project repo
17
+ * Update your hosts file with the IP address of your server (this can be found in your Droplet). If you go down to "Multistage", you'll see an excellent example of what your hosts file should look like.
18
+ * Fill in missing values in `tape_vars.yml`. Should look something like this:
19
+ ```
20
+ app_name: [app name]
21
+
22
+ be_app_repo: [git repo]
23
+
24
+ dev_key_files:
25
+ - dev_keys/name1.pub
26
+ - dev_keys/name2.pub
27
+ ```
28
+ * Copy all developers public keys into a new directory (dev_keys is a good example for the name of that directory). Then specify that dir inside `tape_vars.yml` (dev_key_files)
29
+ * `$ tape ansible everything`
19
30
 
20
31
  **Upgrade**
21
32
 
@@ -40,7 +40,9 @@ class AnsibleRunner < ExecutionModule
40
40
  proc {ansible_deploy '-t be_deploy,fe_deploy'},
41
41
  "Checks out app code, installs dependencies and restarts unicorns for "\
42
42
  "both FE and BE code."
43
- action :everything, proc {ansible}, "This does it all."
43
+ action :everything,
44
+ proc { ansible if valid_preconfigs },
45
+ "This does it all."
44
46
 
45
47
  def initialize(*args)
46
48
  super
@@ -49,6 +51,25 @@ class AnsibleRunner < ExecutionModule
49
51
  protected
50
52
  attr_reader :opts
51
53
 
54
+ def valid_preconfigs
55
+ if rails_app?
56
+ return valid_gems
57
+ end
58
+ end
59
+
60
+ def valid_gems
61
+ has_gem_in_gemfile('unicorn')
62
+ end
63
+
64
+ def has_gem_in_gemfile(name)
65
+ if open('Gemfile').grep(/#{name}/).empty?
66
+ puts "💥 ERROR: Add #{name} to your Gemfile!💥 ".red
67
+ false
68
+ else
69
+ true
70
+ end
71
+ end
72
+
52
73
  def ansible(cmd_str = '')
53
74
  exec_ansible('omnibox.yml', cmd_str)
54
75
  end
data/lib/tape.rb CHANGED
@@ -41,6 +41,14 @@ module TapeBoxer
41
41
  self.class.actions
42
42
  end
43
43
 
44
+ def fe_app?
45
+ !Dir["#{local_dir}/gulpfile.*"].empty?
46
+ end
47
+
48
+ def rails_app?
49
+ !Dir["#{local_dir}/config.ru"].empty?
50
+ end
51
+
44
52
  def execute_action(action)
45
53
  action = action.to_sym
46
54
  unless actions.include?(action)
@@ -1,3 +1,7 @@
1
1
  - name: Ensure gulp is installed
2
2
  npm: name=gulp state=present global=yes
3
3
  when: fe_app_repo is defined
4
+
5
+ - name: Ensure bower is installed
6
+ npm: name=bower state=present global=yes
7
+ when: fe_app_repo is defined
data/taperole.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "taperole"
3
- spec.version = '1.2.7'
3
+ spec.version = '1.2.8'
4
4
  spec.authors = ['Jack Forrest', 'Smashing Boxes', 'Brandon Mathis']
5
5
  spec.email = ['jack@smashingboxes.com', 'brandon@sbox.es']
6
6
  spec.summary = 'A tool for provisioning and deploying boxes for hosting Rails apps'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taperole
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Forrest
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-08-31 00:00:00.000000000 Z
13
+ date: 2015-09-08 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description:
16
16
  email:
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  version: '0'
221
221
  requirements: []
222
222
  rubyforge_project:
223
- rubygems_version: 2.4.6
223
+ rubygems_version: 2.4.5
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: A tool for provisioning and deploying boxes for hosting Rails apps