eventhub-command 0.0.12 → 0.0.13

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: 8d27dd1024bb8346baf6d042be00cd1cf56cadf2
4
- data.tar.gz: cdbf81424e09178b2b8c26bb3d2a056a0a61cc72
3
+ metadata.gz: ba3d6e338834b99051322aea2329026c26830ce3
4
+ data.tar.gz: f72a2cef884ebbbca9d57b77a135ec1a5aa3e0bd
5
5
  SHA512:
6
- metadata.gz: 74a0157d27669b3033b58fddff96121a165e9d7674db544e4b646209ca0d7f3cb36c9daa896d36c66fd3b952349024a16364c6d5b2cf693dd5f052bc732ff2ba
7
- data.tar.gz: 925ce0cd900517a1fa210585e5f7956ef97c3428e93bacd93118b0bfc39e34c6662ed4ce8fd5a67d75727fa6362ae2ad4efece79149579f42fcfb00bd800423a
6
+ metadata.gz: 573d7df9b40828426c7cbcc8b8180d9bd16820e715436d5eb3ff2d98336bc904958a8074cf71d0f3ead00086ae287056c412a6b455c1e9ba4c89ff3950d93b82
7
+ data.tar.gz: 2400c7f2fcbdc7a9065ab163fe87cade55df2aa95d6ca40c9dd286f0c97ce06d4581159d788dcd40fb26ce24957cac7945a9b7241291a1a1ac38171d94fd0329
data/lib/eh-commands.rb CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
2
  # All commands are required here
3
+ require 'eh/commands/deploy'
3
4
  require 'eh/commands/copy_config'
4
5
  require 'eh/commands/generate_processor'
5
6
  require 'eh/commands/package_rails'
@@ -0,0 +1,38 @@
1
+ desc 'Deploys the app'
2
+ arg_name 'stage', optional: true
3
+ command :deploy do |c|
4
+
5
+ c.flag([:deploy_via], :desc => "One of 'copy' or 'scm'", :default_value => 'scm')
6
+ c.flag([:copy_from_dir], :desc => "Source directory for copy operation", :default_value => Eh::Settings.current.releases_dir)
7
+ c.flag([:tag], :desc => "The tag to deploy")
8
+ c.flag([:branch], :desc => "The branch to deploy", :default_value => "master")
9
+
10
+ c.action do |global_options, options, args|
11
+ stage = args[0] || "development"
12
+
13
+ deployment_dir = Eh::Settings.current.deployment_dir
14
+
15
+ env_variables = []
16
+ env_variables << "DEPLOY_VIA=#{options[:deploy_via]}"
17
+
18
+ if options[:tag]
19
+ env_variables << "TAG=#{options[:tag]}"
20
+ else
21
+ env_variables << "BRANCH=#{options[:branch]}"
22
+ end
23
+
24
+ if options[:deploy_via] == "copy"
25
+ env_variables << "COPY_FROM_DIR=#{options[:copy_from_dir]}"
26
+ end
27
+
28
+ cmd = "cd #{deployment_dir} && #{env_variables.join(' ')} bundle exec cap #{stage} event_hub"
29
+
30
+ puts "Command: #{cmd}" if global_options['v']
31
+
32
+ Bundler.with_clean_env do
33
+ system cmd
34
+ end
35
+
36
+ puts "Done."
37
+ end
38
+ end
data/lib/eh/settings.rb CHANGED
@@ -23,20 +23,28 @@ class Eh::Settings
23
23
  File.expand_path(data['repository_root_dir'])
24
24
  end
25
25
 
26
+ def releases_dir
27
+ File.join(repository_root_dir, 'releases')
28
+ end
29
+
30
+ def rails_release_dir
31
+ File.join(releases_dir, 'rails')
32
+ end
33
+
26
34
  def ruby_release_dir
27
- File.join(repository_root_dir, 'releases', 'ruby')
35
+ File.join(releases_dir, 'ruby')
28
36
  end
29
37
 
30
38
  def processes_src_dir
31
39
  File.join(repository_root_dir, 'src', 'process')
32
40
  end
33
41
 
34
- def rails_src_dir
35
- File.join(repository_root_dir, 'src', 'rails', 'console')
42
+ def deployment_dir
43
+ File.join(repository_root_dir, 'src', 'deployment')
36
44
  end
37
45
 
38
- def rails_release_dir
39
- File.join(repository_root_dir, 'releases', 'rails')
46
+ def rails_src_dir
47
+ File.join(repository_root_dir, 'src', 'rails', 'console')
40
48
  end
41
49
 
42
50
  def source_config_dir
data/lib/eh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eh
2
- VERSION = '0.0.12'
2
+ VERSION = '0.0.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventhub-command
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pascal Betz
@@ -120,6 +120,7 @@ files:
120
120
  - lib/eh-commands.rb
121
121
  - lib/eh.rb
122
122
  - lib/eh/commands/copy_config.rb
123
+ - lib/eh/commands/deploy.rb
123
124
  - lib/eh/commands/generate_processor.rb
124
125
  - lib/eh/commands/package.rb
125
126
  - lib/eh/commands/package_rails.rb