pike 0.0.1 → 0.0.2

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: 7fb975855d3b151edfc497b4b44b362c7b8005f6
4
- data.tar.gz: 046f89d3bd1d0885d18e5f8c77a78ce5937f3d95
3
+ metadata.gz: 30de0c65903d06cbd3f718c6af49e5c8cc2e918c
4
+ data.tar.gz: 7c7b4ec937f3b7685c2de7cc9c0aa775644f57de
5
5
  SHA512:
6
- metadata.gz: 228f43c695a7a628c0f56eafe55bace606b7d04df0ab92ce333345aa4b8a79945badf240db5d724bb981da3864cb593454172179e9d50333e65d42aa290a5dac
7
- data.tar.gz: 35577733d5f61f2ca7432f5e982e5db93cbaac2e65796f91d7821d341d78697ec8cc378293c971c85e73036e1666a3f5afa394762df81f8d5ca9baa7fe266e24
6
+ metadata.gz: 60f92c1f3d902ab47a03aa2512ca03c2995b39dd55199000c57523f030f5c851e60d7628d70180a6a578afa36a92c062000f123229c7efc2cd4d5c9412935941
7
+ data.tar.gz: fca17b722cbf1c71283c1a1e9762efd4af75df61acbdc32fa902a5aa9d5245ece7c843729d2b0219db7bee4953b9f293ac80edfbb9a7d0b51912767a01892b1d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pike (0.0.1)
4
+ pike (0.0.2)
5
5
  net-scp (~> 1.0)
6
6
  net-ssh (~> 2.1)
7
7
  net-ssh-shell (~> 0.2)
@@ -18,7 +18,7 @@ GEM
18
18
  term-ansicolor
19
19
  thor
20
20
  docile (1.1.2)
21
- highline (1.6.20)
21
+ highline (1.6.21)
22
22
  mime-types (2.0)
23
23
  multi_json (1.8.4)
24
24
  net-scp (1.0.4)
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![Code Climate](https://codeclimate.com/github/phortx/pike.png)](https://codeclimate.com/github/phortx/pike)
7
7
 
8
8
 
9
- **Warning:** This is an very very early state of development and the codebase is really ugly and cluttered. Don't use it yet.
9
+ **Warning:** This is an early state of development. There may be bugs and uncomplete features. Use it at your own risk.
10
10
 
11
11
 
12
12
 
@@ -43,15 +43,16 @@ The goal of pike is to ship a smart but easy to use deployment automation system
43
43
  ## Usage
44
44
  1. Read the [Pikefile documentation](https://github.com/phortx/pike/wiki/Pikefile)
45
45
  2. Setup a Pikefile
46
- 3. Run <code>pike your_environment setup</code> which will setup the infrastructure initially on your server
47
- 4. After that you can deploy the app via <code>pike your_environment</code>
46
+ 3. Run `pike your_environment setup` which will setup the infrastructure initially on your server
47
+ 4. After that you can deploy the app via `pike your_environment` or just `pike` if your environment is named `production`
48
48
 
49
+ ![Screenshot](https://raw.github.com/phortx/pike/master/screenshot.png)
49
50
 
50
51
 
51
52
 
52
53
  ## Documentation
53
54
  * [Pikefile](https://github.com/phortx/pike/wiki/Pikefile)
54
- * [Buildint tasks](https://github.com/phortx/pike/wiki/Tasks)
55
+ * [Buildin tasks](https://github.com/phortx/pike/wiki/Tasks)
55
56
  * [Write your own Tasks](https://github.com/phortx/pike/wiki/Write-Tasks)
56
57
 
57
58
 
data/lib/pike/env.rb CHANGED
@@ -58,19 +58,25 @@ module Pike
58
58
  ##
59
59
  ## Runs a single task from that environment
60
60
  ##
61
+
61
62
  def run_single_task(name)
62
63
  prepare
63
64
 
64
65
  task_to_run = nil
65
- lifecycle.each do |task|
66
- if task[0] == name
67
- task_to_run = task
68
- break
66
+
67
+ if name.to_s.eql?('setup')
68
+ task_to_run = [name, {}]
69
+ else
70
+ lifecycle.each do |task|
71
+ if task[0] == name
72
+ task_to_run = task
73
+ break
74
+ end
69
75
  end
70
76
  end
71
77
 
72
78
  if task_to_run == nil
73
- Main.error("Unkown task '#{name}'")
79
+ Main.error("Unknown task '#{name}'")
74
80
  else
75
81
  run_task(task_to_run[0], task_to_run[1])
76
82
  end
@@ -26,7 +26,7 @@ module Pike
26
26
 
27
27
  def self.build_tar_file(tarfile)
28
28
  Gem::Package::TarWriter.new(tarfile) do |tar|
29
- files = Dir.glob('**/*', File::FNM_DOTMATCH).reject! {|f| f =~ /^tmp|log/i || f =~ /^\.\.?$/ }
29
+ files = Dir.glob('**/*', File::FNM_DOTMATCH).reject! {|f| f =~ /^(tmp|log)/i || f =~ /^\.\.?$/ }
30
30
 
31
31
  files.each do |file|
32
32
  mode = File.stat(file).mode
@@ -61,6 +61,9 @@ module Pike
61
61
  ##
62
62
 
63
63
  def run(env)
64
+ # For logging the time
65
+ start_time = Time.now
66
+
64
67
  # Log command
65
68
  Logger.log get_cmd_prefix
66
69
  report("#{where == :remote ? '>' : '<'} #{to_s}") if Main.verbose
@@ -68,28 +71,49 @@ module Pike
68
71
  # Determine target environment
69
72
  target = (where == :local ? Local.new(@task) : Remote.new(@task))
70
73
 
74
+ re = true
75
+
71
76
  unless Main.dry_run
72
77
  # Mode depending routines
73
78
  case @mode
74
79
  when :cmd
75
- return target.run("#{var_string} #{sudo}#{@cmd}")
80
+ re = target.run("#{var_string} #{sudo}#{@cmd}")
81
+ log_time(start_time)
76
82
 
77
83
  when :cd
78
- return target.cd(@cd_to)
84
+ re = target.cd(@cd_to)
85
+ log_time(start_time)
79
86
 
80
87
  when :bundler
81
- return target.bundler(@cmd, var_string, sudo?)
88
+ re = target.bundler(@cmd, var_string, sudo?)
89
+ log_time(start_time)
82
90
 
83
91
  when :build_rba
84
- return build_rba
92
+ re = build_rba
93
+ log_time(start_time)
85
94
 
86
95
  when :scp
87
- SSH::Connection.scp(@local, @remote, env.get_var(:host))
96
+ re = SSH::Connection.scp(@local, @remote, env.get_var(:host))
97
+ log_time(start_time)
88
98
 
89
99
  else
90
100
  Main.error("Unkown command mode #{@mode}")
91
101
  end
92
102
  end
103
+
104
+ return re
105
+ end
106
+
107
+
108
+ ##
109
+ ## Logs how long the command ran
110
+ ##
111
+
112
+ def log_time(start_time)
113
+ time = Time.at(Time.now - start_time).utc
114
+ Logger.log
115
+ Logger.log "Time: #{time.strftime('%k:%M:%S.%L')}"
116
+ Logger.log
93
117
  end
94
118
 
95
119
 
@@ -164,5 +164,5 @@ task :restart do
164
164
  end
165
165
 
166
166
  task :setup do
167
- remote "mkdir -p #{get :deploy_to}/.pike/releases"
167
+ remote "mkdir -p #{get :deploy_to}.pike/releases"
168
168
  end
data/lib/pike/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pike
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/screenshot.png ADDED
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pike
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Kammerl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-13 00:00:00.000000000 Z
11
+ date: 2014-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -130,6 +130,7 @@ files:
130
130
  - lib/pike/tasks/tasks.rb
131
131
  - lib/pike/version.rb
132
132
  - pike.gemspec
133
+ - screenshot.png
133
134
  - script/build
134
135
  - spec/spec_helper.rb
135
136
  homepage: https://github.com/phortx/pike