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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +5 -4
- data/lib/pike/env.rb +11 -5
- data/lib/pike/rba/builder.rb +1 -1
- data/lib/pike/tasks/command.rb +29 -5
- data/lib/pike/tasks/tasks.rb +1 -1
- data/lib/pike/version.rb +1 -1
- data/screenshot.png +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30de0c65903d06cbd3f718c6af49e5c8cc2e918c
|
4
|
+
data.tar.gz: 7c7b4ec937f3b7685c2de7cc9c0aa775644f57de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
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
|
47
|
-
4. After that you can deploy the app via
|
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
|
-
* [
|
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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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("
|
79
|
+
Main.error("Unknown task '#{name}'")
|
74
80
|
else
|
75
81
|
run_task(task_to_run[0], task_to_run[1])
|
76
82
|
end
|
data/lib/pike/rba/builder.rb
CHANGED
@@ -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
|
data/lib/pike/tasks/command.rb
CHANGED
@@ -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
|
-
|
80
|
+
re = target.run("#{var_string} #{sudo}#{@cmd}")
|
81
|
+
log_time(start_time)
|
76
82
|
|
77
83
|
when :cd
|
78
|
-
|
84
|
+
re = target.cd(@cd_to)
|
85
|
+
log_time(start_time)
|
79
86
|
|
80
87
|
when :bundler
|
81
|
-
|
88
|
+
re = target.bundler(@cmd, var_string, sudo?)
|
89
|
+
log_time(start_time)
|
82
90
|
|
83
91
|
when :build_rba
|
84
|
-
|
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
|
|
data/lib/pike/tasks/tasks.rb
CHANGED
data/lib/pike/version.rb
CHANGED
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.
|
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-
|
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
|