eventhub-command 0.0.12 → 0.0.13
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 +4 -4
- data/lib/eh-commands.rb +1 -0
- data/lib/eh/commands/deploy.rb +38 -0
- data/lib/eh/settings.rb +13 -5
- data/lib/eh/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba3d6e338834b99051322aea2329026c26830ce3
|
4
|
+
data.tar.gz: f72a2cef884ebbbca9d57b77a135ec1a5aa3e0bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 573d7df9b40828426c7cbcc8b8180d9bd16820e715436d5eb3ff2d98336bc904958a8074cf71d0f3ead00086ae287056c412a6b455c1e9ba4c89ff3950d93b82
|
7
|
+
data.tar.gz: 2400c7f2fcbdc7a9065ab163fe87cade55df2aa95d6ca40c9dd286f0c97ce06d4581159d788dcd40fb26ce24957cac7945a9b7241291a1a1ac38171d94fd0329
|
data/lib/eh-commands.rb
CHANGED
@@ -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(
|
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
|
35
|
-
File.join(repository_root_dir, 'src', '
|
42
|
+
def deployment_dir
|
43
|
+
File.join(repository_root_dir, 'src', 'deployment')
|
36
44
|
end
|
37
45
|
|
38
|
-
def
|
39
|
-
File.join(repository_root_dir, '
|
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
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.
|
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
|