eventhub-command 0.3.4 → 0.3.5

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: 236d7f8d467fdf7b76dde7fd5707a1ac5653ad16
4
- data.tar.gz: 1dfa5768caa12318cd8f8aeaa63e5679bc43144b
3
+ metadata.gz: be6caed5c1667e872d1518de92673b5e1c479f15
4
+ data.tar.gz: 5ecb3e749cc7cbf27cd319c905273ae4147548fd
5
5
  SHA512:
6
- metadata.gz: 9aeea1a4e819ea20af99aa7b3d8ca4b17933f57711323eba8937e058ddbe095d5924fe4b1f65c87e84299fa0517754ef2b64287ae452bc5c358ef1945ad12c9f
7
- data.tar.gz: fdb043db919e3e60f4776b10cb072ce7cf09b6b9c028e2e0ec8f9d7e077512cb2591fc97a639a22f32eed019fce7eb526cbb20bf494d5d6f90136f46fdcbe5ff
6
+ metadata.gz: 4f2c1fcda1624c56acb2de15f666b2d65d8564af4bc6d15efbdaa8d18245c94a7e7b1f117d6677c57b423d43f3b228b6ed81ed77c38be3297c1b2301cfbb8f61
7
+ data.tar.gz: fdc239a453ec98671cfafe2ead31c21caa7b23ec02b435ef757697e5b2cd7c96357a79599bdbc4692d687a1fbee968a4d4166faf0c5cb48fa03ed3b185be8ccf
data/lib/eh-commands.rb CHANGED
@@ -3,7 +3,7 @@ if Eh::Settings.current.repository
3
3
  require 'eh/commands/generate_processor'
4
4
  require 'eh/commands/package_ruby'
5
5
  require 'eh/commands/package_rails'
6
- require 'eh/commands/list_stages'
6
+ require 'eh/commands/stage'
7
7
  require 'eh/commands/deploy_config'
8
8
  require 'eh/commands/deploy_ruby'
9
9
  require 'eh/commands/deploy_mule'
@@ -1,7 +1,7 @@
1
1
  desc 'distribute the configs to the nodes'
2
2
 
3
3
  command :deploy_config do |c|
4
- c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: 'development')
4
+ c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: Eh::Settings.current.default_stage)
5
5
  c.flag([:branch], desc: 'branch', type: String, long_desc: 'What branch to deploy. Only when deploy_via=scm', default_value: 'master')
6
6
  c.flag([:tag], desc: 'tag', type: String, long_desc: 'What tag to deploy. Only when deploy_via=scm', default_value: nil)
7
7
 
@@ -1,7 +1,7 @@
1
1
  desc 'deploy the console rails app'
2
2
 
3
3
  command :deploy_console do |c|
4
- c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: 'development')
4
+ c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: Eh::Settings.current.default_stage)
5
5
  c.flag([:branch], desc: 'branch', type: String, long_desc: 'What branch to deploy. Only when deploy_via=scm', default_value: 'master')
6
6
  c.flag([:tag], desc: 'tag', type: String, long_desc: 'What tag to deploy. Only when deploy_via=scm', default_value: nil)
7
7
  c.flag([:deploy_via], desc: 'where to deploy from', type: String, long_desc: 'deploy via scm or scp. If you use scp then the working_dir is packaged and copied tot the servers', default_value: 'svn')
@@ -2,7 +2,7 @@ desc 'deploy a single channel adapter'
2
2
  arg_name '[channel_adapter[,other_channel_adapter,pattern*]]'
3
3
 
4
4
  command :deploy_mule do |c|
5
- c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where channel adapter is deployed to', default_value: 'development')
5
+ c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where channel adapter is deployed to', default_value: Eh::Settings.current.default_stage)
6
6
  c.flag([:deploy_via], desc: 'how to get hold of the channel adapter: scm or scp', type: String, long_desc: 'copy the channel adapter zip file via scp from this machine or check it out from scm', default_value: 'svn')
7
7
 
8
8
  c.switch([:v, :verbose], :desc => 'Show additional output.')
@@ -2,7 +2,7 @@ desc 'deploy a single ruby processor'
2
2
  arg_name '[processor_name,[other_processor_name,pattern*]]'
3
3
 
4
4
  command :deploy_ruby do |c|
5
- c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: 'development')
5
+ c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: Eh::Settings.current.default_stage)
6
6
  c.flag([:deploy_via], desc: 'how to get hold of the processor: scm or scp', type: String, long_desc: 'copy the processor zip file via scp from this machine or check it out from scm', default_value: 'svn')
7
7
  c.flag([:branch], desc: 'branch', type: String, long_desc: 'What branch to deploy. Only when deploy_via=scm', default_value: 'master')
8
8
  c.flag([:tag], desc: 'tag', type: String, long_desc: 'What tag to deploy. Only when deploy_via=scm', default_value: nil)
@@ -2,7 +2,7 @@ desc "manage repositories"
2
2
 
3
3
  command :dump do |command|
4
4
  command.desc "Create a backup"
5
- command.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: 'development')
5
+ command.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: Eh::Settings.current.default_stage)
6
6
  command.switch([:v, :verbose], :desc => 'Show additional output.')
7
7
 
8
8
  command.command :download do |command|
@@ -0,0 +1,24 @@
1
+ desc 'manage stages'
2
+ command :stage do |command|
3
+
4
+ command.switch([:v, :verbose], :desc => 'Show additional output.')
5
+ command.command :list do |c|
6
+ c.action do |global_options, options, args|
7
+ dir = Eh::Settings.current.stages_dir
8
+ puts "Checking in #{dir}".green if options[:verbose]
9
+ puts "Available stages are:".blue
10
+ Dir.glob(File.join(dir, '*.yml')) do |name|
11
+ stage_name = File.basename(name, '.*')
12
+ default = '(default)' if Eh::Settings.current.default_stage == stage_name
13
+ puts "#{stage_name} #{default}".light_blue
14
+ end
15
+ end
16
+ end
17
+ command.command :select_default do |c|
18
+ c.action do |global_options, options, args|
19
+ stage = args[0]
20
+ Eh::Settings.current.data['default_stage'] = stage
21
+ Eh::Settings.current.write
22
+ end
23
+ end
24
+ end
data/lib/eh/settings.rb CHANGED
@@ -28,6 +28,10 @@ class Eh::Settings
28
28
  end
29
29
  end
30
30
 
31
+ def default_stage
32
+ @data['default_stage'] || 'development'
33
+ end
34
+
31
35
  def initialize(file)
32
36
  @file = file
33
37
  @data = JSON.parse(File.read(file))
data/lib/eh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eh
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.5'
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.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pascal Betz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-05 00:00:00.000000000 Z
12
+ date: 2015-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -159,10 +159,10 @@ files:
159
159
  - lib/eh/commands/deploy_ruby.rb
160
160
  - lib/eh/commands/dump.rb
161
161
  - lib/eh/commands/generate_processor.rb
162
- - lib/eh/commands/list_stages.rb
163
162
  - lib/eh/commands/package_rails.rb
164
163
  - lib/eh/commands/package_ruby.rb
165
164
  - lib/eh/commands/repository.rb
165
+ - lib/eh/commands/stage.rb
166
166
  - lib/eh/settings.rb
167
167
  - lib/eh/version.rb
168
168
  - test/default_test.rb
@@ -1,17 +0,0 @@
1
- desc 'list the available stages'
2
-
3
- command :list_stages do |c|
4
- #c.flag([:branch], desc: 'branch', type: String, long_desc: 'What branch to deploy. Only when deploy_via=scm', default_value: 'master')
5
- #c.flag([:tag], desc: 'tag', type: String, long_desc: 'What tag to deploy. Only when deploy_via=scm', default_value: nil)
6
-
7
- c.switch([:v, :verbose], :desc => 'Show additional output.')
8
-
9
- c.action do |global_options, options, args|
10
- dir = Eh::Settings.current.stages_dir
11
- puts "Checking in #{dir}".green if options[:verbose]
12
- puts "Available stages are:".blue
13
- Dir.glob(File.join(dir, '*.yml')) do |name|
14
- puts "#{File.basename(name, '.*')}".light_blue
15
- end
16
- end
17
- end