skynet-deploy 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/skynet/builder/base.rb +5 -0
- data/lib/skynet/builder/jekyll.rb +1 -3
- data/lib/skynet/builder/static.rb +1 -3
- data/lib/skynet/cli.rb +1 -1
- data/lib/skynet/version.rb +1 -1
- data/skynet.gemspec +1 -1
- data/spec/skynet/builder/base_spec.rb +7 -1
- data/spec/skynet/builder/jekyll_spec.rb +1 -0
- data/spec/skynet/builder/static_spec.rb +3 -0
- metadata +2 -2
data/lib/skynet/builder/base.rb
CHANGED
@@ -32,6 +32,11 @@ module Skynet
|
|
32
32
|
Skynet.logger.error errors.full_messages.join '. '
|
33
33
|
raise ArgumentError
|
34
34
|
end
|
35
|
+
|
36
|
+
build_repository
|
37
|
+
|
38
|
+
Skynet.logger.debug "Removing #{destination}/*"
|
39
|
+
FileUtils.rm_rf Dir.glob(File.join destination, '*'), secure: true
|
35
40
|
end
|
36
41
|
|
37
42
|
private
|
@@ -5,10 +5,8 @@ module Skynet
|
|
5
5
|
class Jekyll < Base
|
6
6
|
|
7
7
|
def build
|
8
|
-
super
|
9
|
-
|
10
8
|
Skynet.logger.info "Jekyll running for #{app}..."
|
11
|
-
|
9
|
+
super
|
12
10
|
|
13
11
|
Skynet.logger.debug "PWD: #{Dir.pwd} Source: #{source} Destination: #{destination}"
|
14
12
|
Skynet.logger.info `jekyll #{source} #{destination}`
|
data/lib/skynet/cli.rb
CHANGED
@@ -83,7 +83,7 @@ module Skynet
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
desc "config [PROJECT_NAME]", "Generate config.yml, stubbed out for
|
86
|
+
desc "config [PROJECT_NAME]", "Generate config.yml, stubbed out for PROJECT_NAME"
|
87
87
|
def config(name="PROJECT_NAME")
|
88
88
|
@project_name = name
|
89
89
|
template('config.yml', 'config.yml')
|
data/lib/skynet/version.rb
CHANGED
data/skynet.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Ryan Ahearn"]
|
10
10
|
s.email = ["ryan@coshx.com"]
|
11
|
-
s.homepage = ""
|
11
|
+
s.homepage = "https://github.com/coshx/skynet"
|
12
12
|
s.summary = %q{Sinatra app that listens for GitHub post-receive callbacks and deploys your code}
|
13
13
|
s.description = %q{Sinatra app that listens for GitHub post-receive callbacks and deploys your code}
|
14
14
|
|
@@ -20,8 +20,14 @@ describe Skynet::Builder::Base do
|
|
20
20
|
|
21
21
|
describe "#build" do
|
22
22
|
context "when valid" do
|
23
|
-
it
|
23
|
+
it "removes files in the destination first" do
|
24
|
+
Dir.stub(:glob).and_return [:one, :two]
|
25
|
+
subject.stub :build_repository
|
26
|
+
FileUtils.should_receive(:rm_rf).with [:one, :two], secure: true
|
27
|
+
subject.build
|
28
|
+
end
|
24
29
|
end
|
30
|
+
|
25
31
|
context "when invalid" do
|
26
32
|
let(:options) { {} }
|
27
33
|
it { expect { subject.build }.to raise_error ArgumentError }
|
@@ -12,15 +12,18 @@ describe Skynet::Builder::Static do
|
|
12
12
|
before(:each) do
|
13
13
|
subject.should_receive :build_repository
|
14
14
|
subject.stub(:valid?).and_return true
|
15
|
+
FileUtils.stub :rm_rf
|
15
16
|
end
|
16
17
|
|
17
18
|
it "copies files to the destination" do
|
19
|
+
FileUtils.stub :rm_rf
|
18
20
|
FileUtils.stub :remove_entry_secure
|
19
21
|
FileUtils.should_receive(:cp_r).with(source, dest)
|
20
22
|
subject.build
|
21
23
|
end
|
22
24
|
|
23
25
|
it "removes .git from the destination" do
|
26
|
+
FileUtils.stub :rm_rf
|
24
27
|
FileUtils.stub :cp_r
|
25
28
|
FileUtils.should_receive(:remove_entry_secure).with "#{dest}/.git"
|
26
29
|
subject.build
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skynet-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -202,7 +202,7 @@ files:
|
|
202
202
|
- spec/skynet/builder/static_spec.rb
|
203
203
|
- spec/skynet/builder_spec.rb
|
204
204
|
- spec/spec_helper.rb
|
205
|
-
homepage:
|
205
|
+
homepage: https://github.com/coshx/skynet
|
206
206
|
licenses: []
|
207
207
|
post_install_message:
|
208
208
|
rdoc_options: []
|