skynet-deploy 1.3.2 → 2.0.0

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
- SHA1:
3
- metadata.gz: 6fe8f04e3036053148e1feda14f9f0867709892f
4
- data.tar.gz: 20c0ebf0228fbbae532956ceb40ab48fd32eede1
2
+ SHA256:
3
+ metadata.gz: d95d2b638d8f8be544d5c42e7e6641cc5cb25d15c7b7ede90cb1619cef4898ee
4
+ data.tar.gz: 2442555551e7836aed334417344571c7e0aaf54e83960e2f3dc4c6d718992445
5
5
  SHA512:
6
- metadata.gz: 1a04d9a1fc85b6aed5a6dab23989a66ad9cd05ca11b2dd86dd77339f0dfc03f82babb68d3ffc9dc4c81a17af03a945a718322c4705e7f97e9a8f27a76687e358
7
- data.tar.gz: 7cb52193446a40724b8b9d389d79dc00b7e91cbbbcb37cfbe7012137dc6cf0c495f744ca1c90bbffc7ea7f0bad093a2f84af7a9d6edea42ae2a8c0d667c35b8d
6
+ metadata.gz: 5c4e37a158a27f1b1e95c448d6ca7b11cf2e66f1398c874a89950fad652bdb338552c9c4724f937c5c9b972b880e3d1021c8d1b6d64544d8ea718822f98dd2db
7
+ data.tar.gz: 9d89854abc786aad9e87e3d1d5061525d2c0aa6431a668e1b67b64e87d39435d8547af35de4a4a24e90b5f3a9aea345454df18c94c22c6105e11a13764f4ed65
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.7.2
@@ -1,6 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.0
4
- - 2.0.0
5
- - 1.9.3
3
+ - 2.7
4
+ - ruby-head
5
+ matrix:
6
+ allow_failures:
7
+ - rvm: ruby-head
6
8
  script: bundle exec rake spec
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Skynet
2
2
  ======
3
3
 
4
- [![Build Status](https://travis-ci.org/coshx/skynet.svg?branch=master)](https://travis-ci.org/coshx/skynet)
4
+ [![Build Status](https://travis-ci.com/rahearn/skynet.svg?branch=master)](https://travis-ci.com/rahearn/skynet)
5
5
 
6
6
  GitHub-aware website builder
7
7
 
@@ -23,7 +23,7 @@ Usage
23
23
  * edit config file to add your repositories
24
24
  * Run builder by hand to ensure everything works: `$ skynet build`
25
25
  * Add `http://YOUR_SKYNET_SERVER/PROJECT_NAME` as a Webhook Payload URL to your repository under
26
- `Settings -> Webhooks & Services`. Choose `application/vnd.github.v3+form` as the Payload version.
26
+ `Settings -> Webhooks`. Choose `application/json` as the Content type.
27
27
  * Start server: `$ skynet server`
28
28
 
29
29
  Config file arguments
@@ -58,3 +58,8 @@ a git server other than GitHub.
58
58
 
59
59
  The URL must be visible from the Skynet server, as it will pull a new
60
60
  copy of the repository from this server.
61
+
62
+ Upgrading from 1.x
63
+ ==================
64
+
65
+ * Private repositories must explicitly set the `repository` key in the config to the ssh-compatible url. Previously this was optional for Github repos
@@ -13,7 +13,7 @@ module Skynet
13
13
  autoload :HookGenerator, 'skynet/hook_generator'
14
14
 
15
15
  def self.logger
16
- @logger ||= Logger.new(STDOUT)
16
+ @logger ||= Logger.new($stdout)
17
17
  end
18
18
 
19
19
  def self.logger=(logger)
@@ -3,19 +3,21 @@ require 'json'
3
3
  require 'active_support/core_ext/object/blank'
4
4
 
5
5
  module Skynet
6
-
7
6
  class App < Sinatra::Base
8
-
9
7
  before do
10
- @payload = JSON.parse params[:payload] unless params[:payload].nil?
8
+ @payload = begin
9
+ JSON.parse request.body.read
10
+ rescue JSON::ParserError
11
+ {}
12
+ end
11
13
  end
12
14
 
13
15
  get '/' do
14
- %[Hello. Check <a href="https://github.com/coshx/skynet">github</a> for more infomation on skynet]
16
+ %[Hello. Check <a href="https://github.com/rahearn/skynet">github</a> for more infomation on skynet]
15
17
  end
16
18
 
17
19
  post '/' do
18
- Skynet.logger.debug "post '/' params: #{params.inspect}"
20
+ Skynet.logger.debug "post '/' payload: #{@payload.inspect}"
19
21
  app_name = settings.config.each { |n, c| break n if c[:url] == @payload['repository']['url'] }
20
22
  if app_name.is_a? String
21
23
  deploy app_name
@@ -26,7 +28,7 @@ module Skynet
26
28
  end
27
29
 
28
30
  post '/:app_name' do |app_name|
29
- Skynet.logger.debug "post '/#{app_name}' params: #{params.inspect}"
31
+ Skynet.logger.debug "post '/#{app_name}' payload: #{@payload.inspect}"
30
32
  deploy app_name
31
33
  end
32
34
 
@@ -44,15 +46,18 @@ module Skynet
44
46
  end
45
47
 
46
48
  def deployable?(config)
49
+ Skynet.logger.debug "Payload url: #{@payload['repository']['url']}"
50
+ Skynet.logger.debug "Payload after: #{@payload['after']}"
47
51
  config.present? &&
48
52
  config[:url] == @payload['repository']['url'] &&
53
+ @payload['after'].present? &&
49
54
  @payload['after'] !~ /^0{40}$/
50
55
  end
51
56
 
52
57
  def branch
58
+ Skynet.logger.debug "Payload ref: #{@payload['ref']}"
53
59
  @payload['ref'] =~ %r[^refs/heads/(.*)$]
54
60
  $1
55
61
  end
56
62
  end
57
-
58
63
  end
@@ -13,7 +13,7 @@ module Skynet
13
13
  attr_accessor :app, :url, :branch, :destination, :branches, :type, :repository
14
14
  attr_reader :source, :key
15
15
 
16
- validates_presence_of :app, :url, :branch, :destination, :branches
16
+ validates_presence_of :app, :url, :branches, :branch, :destination
17
17
  validates_inclusion_of :type,
18
18
  in: ALLOWED_BUILDERS,
19
19
  message: "must be one of #{ALLOWED_BUILDERS}"
@@ -26,26 +26,28 @@ module Skynet
26
26
  @source = File.join Dir.pwd, app, '.'
27
27
  @key = config[:key]
28
28
 
29
- if config[:branches].blank?
30
- Skynet.logger.warn "Passing a single branch and destination is deprecated and will be removed in 2.0"
31
- Skynet.logger.warn "Please change to:\nbranches:\n #{config[:branch]}: #{config[:destination]}"
32
- self.branches = { config[:branch] => config[:destination] }
33
- else
34
- self.branches = config[:branches]
29
+ self.branches = config[:branches]
30
+ if branches.present? && branches.first.present?
31
+ self.branch = branches.first[0]
32
+ self.destination = branches.first[1]
35
33
  end
36
- self.branch = branches.first[0]
37
- self.destination = branches.first[1]
38
- self.url = config[:url]
39
- self.type = config[:type]
40
- self.repository = config[:repository]
34
+ self.url = config[:url]
35
+ self.type = config[:type]
36
+ self.repository = config[:repository]
41
37
  end
42
38
 
43
39
  def build(branch=nil)
44
- unless branch.blank?
40
+ if branch.present?
45
41
  return if branches[branch].blank?
46
42
  self.branches = { branch => branches[branch] }
47
43
  end
48
44
 
45
+ unless valid?
46
+ Skynet.logger.error "Configuration error for #{app} (branch: #{branch})"
47
+ Skynet.logger.error errors.full_messages.join '. '
48
+ raise ArgumentError
49
+ end
50
+
49
51
  branches.each_pair do |branch, destination|
50
52
  self.branch = branch.to_s
51
53
  self.destination = destination
@@ -70,18 +72,7 @@ module Skynet
70
72
  end
71
73
 
72
74
  def remote_repository
73
- repository || translate_url
74
- end
75
-
76
- def translate_url
77
- uri = URI.parse url
78
- if uri.host == 'github.com'
79
- "git@github.com:#{uri.path.gsub %r[(^/)|(/$)|(\.git$)], ''}.git"
80
- else
81
- url
82
- end
83
- rescue URI::InvalidURIError
84
- url
75
+ repository || url
85
76
  end
86
77
 
87
78
  def create_repo
@@ -20,9 +20,9 @@ module Skynet
20
20
  method_option :port, type: :numeric, default: 7575, aliases: '-p', desc: 'Port to listen on'
21
21
  method_option :host, type: :string, default: '0.0.0.0', aliases: '-h', desc: 'Interface to listen on'
22
22
  method_option :file, type: :string, default: './config.yml', aliases: '-f', desc: 'Configuration file'
23
- method_option :log, type: :string, default: 'skynet.log', aliases: '-l', desc: 'Log file'
23
+ method_option :log, type: :string, aliases: '-l', desc: 'Log file'
24
24
  def server
25
- Skynet.logger = Logger.new options[:log], 'weekly'
25
+ Skynet.logger = Logger.new(options[:log], 'weekly') unless options[:log].nil?
26
26
 
27
27
  unless File.exist? options[:file]
28
28
  Skynet.logger.fatal "Configuration file #{options[:file]} cannot be found"
@@ -1,3 +1,3 @@
1
1
  module Skynet
2
- VERSION = "1.3.2"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -19,9 +19,9 @@ module Skynet
19
19
  def repository_url
20
20
  if ask('Is the repository on github? (y/n)').downcase == 'y'
21
21
  @github = true
22
- owner = ask 'Repository owner:'
23
- project = ask 'Github project name:'
24
- "https://github.com/#{owner}/#{project}"
22
+ @owner = ask 'Repository owner:'
23
+ @project = ask 'Github project name:'
24
+ "https://github.com/#{@owner}/#{@project}"
25
25
  else
26
26
  @github = false
27
27
  ask 'Repository URL:'
@@ -40,9 +40,13 @@ module Skynet
40
40
  def private_key
41
41
  needs_key = ask('Is this a private repository? (y/n)').downcase
42
42
  if needs_key == 'y'
43
- [" key: #{ask 'Full path to ssh key:'}"].tap do |pk|
44
- pk << " repository: #{ask 'SSH repository address:'}" unless @github
45
- end.join "\n"
43
+ private_configs = [" key: #{ask 'Full path to ssh key:'}"]
44
+ if @github
45
+ private_configs << " repository: git@github.com:#{@owner}/#{@project}.git"
46
+ else
47
+ private_configs << " repository: #{ask 'SSH repository address:'}"
48
+ end
49
+ private_configs.join "\n"
46
50
  else
47
51
  nil
48
52
  end
@@ -7,28 +7,28 @@ Gem::Specification.new do |s|
7
7
  s.version = Skynet::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Ryan Ahearn"]
10
- s.email = ["ryan@coshx.com"]
11
- s.homepage = "https://github.com/coshx/skynet"
10
+ s.email = ["ryan.ahearn@hey.com"]
11
+ s.homepage = "https://github.com/rahearn/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
 
15
- s.required_rubygems_version = ">= 1.3.6"
15
+ s.required_ruby_version = ">= 2.7.1"
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_runtime_dependency 'sinatra', '~> 1.3'
23
- s.add_runtime_dependency 'thin', '~> 1.4'
24
- s.add_runtime_dependency 'json', '~> 1.7'
25
- s.add_runtime_dependency 'jekyll', '~> 1.5'
26
- s.add_runtime_dependency 'thor', '~> 0.16'
27
- s.add_runtime_dependency 'activesupport', '~> 4.0'
28
- s.add_runtime_dependency 'activemodel', '~> 4.0'
29
- s.add_runtime_dependency 'multi_json', '~> 1.0'
22
+ s.add_runtime_dependency 'sinatra', '~> 2.1'
23
+ s.add_runtime_dependency 'thin', '~> 1.7'
24
+ s.add_runtime_dependency 'json', '~> 2.3'
25
+ s.add_runtime_dependency 'jekyll', '~> 4.1'
26
+ s.add_runtime_dependency 'thor', '~> 1.0'
27
+ s.add_runtime_dependency 'activesupport', '~> 6.0'
28
+ s.add_runtime_dependency 'activemodel', '~> 6.0'
29
+ s.add_runtime_dependency 'multi_json', '~> 1.15'
30
30
 
31
- s.add_development_dependency 'rake', '~> 10.2'
32
- s.add_development_dependency 'rspec', '~> 2.11'
33
- s.add_development_dependency 'shoulda-matchers', '~> 2.5'
31
+ s.add_development_dependency 'rake', '~> 13.0'
32
+ s.add_development_dependency 'rspec', '~> 3.9'
33
+ s.add_development_dependency 'shoulda-matchers', '~> 4.4'
34
34
  end
@@ -1,13 +1,11 @@
1
1
  require 'spec_helper'
2
- require 'active_model'
3
- require 'shoulda-matchers'
4
2
 
5
- describe Skynet::Builder::Base do
3
+ describe Skynet::Builder::Base, type: :model do
6
4
 
7
5
  let(:source) { File.join Dir.pwd, 'app', '.' }
8
6
  let(:url) { 'https://github.com/org/app' }
9
7
  let(:repo) { 'git@github.com:org/app.git' }
10
- let(:options) { {url: url, branch: 'master', destination: '/var/www', type: 'static'} }
8
+ let(:options) { {url: url, branches: {main: '/var/www'}, type: 'static'} }
11
9
  subject { described_class.new 'app', options }
12
10
 
13
11
  describe ".validations" do
@@ -16,48 +14,48 @@ describe Skynet::Builder::Base do
16
14
  it { should validate_presence_of :branch }
17
15
  it { should validate_presence_of :destination }
18
16
  it { should validate_presence_of :branches }
19
- it { should ensure_inclusion_of(:type).in_array(%w[static jekyll]).allow_nil(false).allow_blank(false) }
17
+ it { should validate_inclusion_of(:type).in_array(%w[static jekyll]).with_message("must be one of [\"static\", \"jekyll\"]") }
20
18
  it { should_not allow_value('base').for :type }
21
19
  describe "on @branches" do
22
20
  before(:each) { subject.valid? }
23
21
 
24
22
  context "when passed a single branch" do
25
- specify { subject.errors[:branches].should be_empty }
23
+ specify { expect(subject.errors[:branches]).to be_empty }
26
24
  end
27
25
  context "when passed multiple valid branches" do
28
- let(:options) { {url: url, type: 'static', branches: {master: '/var/www/production', develop: '/var/www/staging'}} }
29
- specify { subject.errors[:branches].should be_empty }
26
+ let(:options) { {url: url, type: 'static', branches: {main: '/var/www/production', develop: '/var/www/staging'}} }
27
+ specify { expect(subject.errors[:branches]).to be_empty }
30
28
  end
31
29
  context "when passed an invalid branch" do
32
- let(:options) { {url: url, type: 'static', branches: {master: '/var/www', develop: ''}} }
30
+ let(:options) { {url: url, type: 'static', branches: {main: '/var/www', develop: ''}} }
33
31
  it "has an error on branches" do
34
- subject.errors[:branches].should include('develop must have a destination')
32
+ expect(subject.errors[:branches]).to include('develop must have a destination')
35
33
  end
36
34
  end
37
35
  end
38
36
  describe "on @key" do
39
37
  context "when not passed a key" do
40
38
  before(:each) { subject.valid? }
41
- specify { subject.errors[:key].should be_empty }
39
+ specify { expect(subject.errors[:key]).to be_empty }
42
40
  end
43
41
 
44
42
  context "when passed a valid key" do
45
- let(:options) { {key: 'keyfile'} }
43
+ let(:options) { {branches: {main: "/tmp"}, key: 'keyfile'} }
46
44
  before(:each) do
47
- File.stub(:readable?).and_return true
45
+ allow(File).to receive(:readable?).and_return true
48
46
  subject.valid?
49
47
  end
50
- specify { subject.errors[:key].should be_empty }
48
+ specify { expect(subject.errors[:key]).to be_empty }
51
49
  end
52
50
 
53
51
  context "when passed an invalid key" do
54
- let(:options) { {key: 'missing_keyfile'} }
52
+ let(:options) { {branches: {main: "/tmp"}, key: 'missing_keyfile'} }
55
53
  before(:each) do
56
- File.stub(:readable?).and_return false
54
+ allow(File).to receive(:readable?).and_return false
57
55
  subject.valid?
58
56
  end
59
57
  it "has an error on key" do
60
- subject.errors[:key].should include('must be present and readable')
58
+ expect(subject.errors[:key]).to include('must be present and readable')
61
59
  end
62
60
  end
63
61
  end
@@ -65,8 +63,8 @@ describe Skynet::Builder::Base do
65
63
 
66
64
  describe "#build" do
67
65
  before(:each) do
68
- subject.stub :build_repository
69
- subject.stub :execute
66
+ allow(subject).to receive(:build_repository)
67
+ allow(subject).to receive(:execute)
70
68
  end
71
69
 
72
70
  context "when valid" do
@@ -77,7 +75,7 @@ describe Skynet::Builder::Base do
77
75
  it { expect { subject.build }.to raise_error ArgumentError }
78
76
  end
79
77
  context "when passing a branch" do
80
- it { expect { subject.build 'master' }.to_not raise_error }
78
+ it { expect { subject.build 'main' }.to_not raise_error }
81
79
  it "d" do
82
80
  subject.build 'develop'
83
81
  end
@@ -86,44 +84,44 @@ describe Skynet::Builder::Base do
86
84
 
87
85
  context "private methods" do
88
86
  before(:each) do
89
- subject.branch = 'master'
87
+ subject.branch = 'main'
90
88
  subject.destination = '/var/www'
91
89
  end
92
90
 
93
91
  describe "#build_repository" do
94
92
  context "repo already exists" do
95
- before(:each) { subject.stub(:repo_exists?).and_return true }
93
+ before(:each) { allow(subject).to receive(:repo_exists?).and_return true }
96
94
 
97
95
  it "updates the repository" do
98
- subject.should_receive(:update_repo).with no_args
96
+ expect(subject).to receive(:update_repo).with no_args
99
97
  subject.send :build_repository
100
98
  end
101
99
  end
102
100
 
103
101
  context "repo does not exist" do
104
- before(:each) { subject.stub(:repo_exists?).and_return false }
102
+ before(:each) { allow(subject).to receive(:repo_exists?).and_return false }
105
103
 
106
104
  it "creates a new repository" do
107
- subject.should_receive(:create_repo).with no_args
105
+ expect(subject).to receive(:create_repo).with no_args
108
106
  subject.send :build_repository
109
107
  end
110
108
  end
111
109
  end
112
110
 
113
111
  describe "#create_repo" do
114
- before(:each) { subject.should_receive(:`).with "rm -rf #{source}" }
112
+ before(:each) { expect(subject).to receive(:`).with "rm -rf #{source}" }
115
113
 
116
114
  context "without key" do
117
115
  it "should call git clone" do
118
- subject.should_receive(:`).with "git clone #{repo} app; cd #{source}; git checkout master"
116
+ expect(subject).to receive(:`).with "git clone #{url} app; cd #{source}; git checkout main"
119
117
  subject.send :create_repo
120
118
  end
121
119
  end
122
120
 
123
121
  context "with key" do
124
- let(:options) { {key: 'keyfile', url: url, branch: 'master', destination: '/var/www', type: 'static'} }
122
+ let(:options) { {key: 'keyfile', url: url, repository: repo, branches: {main: '/var/www'}, type: 'static'} }
125
123
  it "should call git clone" do
126
- subject.should_receive(:`).with "ssh-agent bash -c 'ssh-add keyfile; git clone #{repo} app'; cd #{source}; git checkout master"
124
+ expect(subject).to receive(:`).with "ssh-agent bash -c 'ssh-add keyfile; git clone #{repo} app'; cd #{source}; git checkout main"
127
125
  subject.send :create_repo
128
126
  end
129
127
  end
@@ -132,15 +130,15 @@ describe Skynet::Builder::Base do
132
130
  describe "#update_repo" do
133
131
  context "without key" do
134
132
  it "should call git pull" do
135
- subject.should_receive(:`).with "cd #{source}; git checkout master; git pull origin master"
133
+ expect(subject).to receive(:`).with "cd #{source}; git checkout main; git pull origin main"
136
134
  subject.send :update_repo
137
135
  end
138
136
  end
139
137
 
140
138
  context "with key" do
141
- let(:options) { {key: 'keyfile', url: url, branch: 'master', destination: '/var/www', type: 'static'} }
139
+ let(:options) { {key: 'keyfile', url: url, branches: {main: '/var/www'}, type: 'static'} }
142
140
  it "should call git pull" do
143
- subject.should_receive(:`).with "cd #{source}; git checkout master; ssh-agent bash -c 'ssh-add keyfile; git pull origin master'"
141
+ expect(subject).to receive(:`).with "cd #{source}; git checkout main; ssh-agent bash -c 'ssh-add keyfile; git pull origin main'"
144
142
  subject.send :update_repo
145
143
  end
146
144
  end
@@ -148,7 +146,7 @@ describe Skynet::Builder::Base do
148
146
 
149
147
  describe "#repo_exists?" do
150
148
  before(:each) do
151
- File.should_receive(:exist?).with File.join(source, '.git')
149
+ expect(File).to receive(:exist?).with(File.join(source, '.git'))
152
150
  end
153
151
 
154
152
  it { subject.send :repo_exists? }
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Skynet::Builder::Jekyll do
3
+ describe Skynet::Builder::Jekyll, type: :model do
4
4
 
5
5
  let(:app) { 'app' }
6
6
  let(:dest) { '/var/www/app' }
7
- let(:options) { {destination: dest} }
7
+ let(:options) { {branches: {main: dest}} }
8
8
  let(:source) { File.join Dir.pwd, app, '.' }
9
9
  subject do
10
10
  described_class.new(app, options).tap do |b|
@@ -14,7 +14,7 @@ describe Skynet::Builder::Jekyll do
14
14
 
15
15
  describe "#execute" do
16
16
  it "runs jekyll with the source and destination" do
17
- subject.should_receive(:`).with "jekyll build --source #{source} --destination #{dest}"
17
+ expect(subject).to receive(:`).with "jekyll build --source #{source} --destination #{dest}"
18
18
  subject.execute
19
19
  end
20
20
  end
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Skynet::Builder::Static do
3
+ describe Skynet::Builder::Static, type: :model do
4
4
 
5
5
  let(:app) { 'app' }
6
6
  let(:dest) { '/var/www/app' }
7
- let(:options) { {destination: dest} }
7
+ let(:options) { {branches: {main: dest}} }
8
8
  let(:source) { File.join Dir.pwd, app, '.' }
9
9
  subject do
10
10
  described_class.new(app, options).tap do |b|
@@ -13,26 +13,26 @@ describe Skynet::Builder::Static do
13
13
  end
14
14
 
15
15
  describe "#execute" do
16
- before(:each) { Dir.stub(:glob).and_return [:one, :two] }
16
+ before(:each) { allow(Dir).to receive(:glob).and_return([:one, :two]) }
17
17
 
18
18
  it "removes destination files first" do
19
- FileUtils.stub :remove_entry_secure
20
- FileUtils.stub :cp_r
21
- FileUtils.should_receive(:rm_rf).with [:one, :two], secure: true
19
+ allow(FileUtils).to receive(:remove_entry_secure)
20
+ allow(FileUtils).to receive(:cp_r)
21
+ expect(FileUtils).to receive(:rm_rf).with([:one, :two], secure: true)
22
22
  subject.execute
23
23
  end
24
24
 
25
25
  it "copies files to the destination" do
26
- FileUtils.stub :rm_rf
27
- FileUtils.stub :remove_entry_secure
28
- FileUtils.should_receive(:cp_r).with(source, dest)
26
+ allow(FileUtils).to receive(:rm_rf)
27
+ allow(FileUtils).to receive(:remove_entry_secure)
28
+ expect(FileUtils).to receive(:cp_r).with(source, dest)
29
29
  subject.execute
30
30
  end
31
31
 
32
32
  it "removes .git from the destination" do
33
- FileUtils.stub :rm_rf
34
- FileUtils.stub :cp_r
35
- FileUtils.should_receive(:remove_entry_secure).with "#{dest}/.git"
33
+ allow(FileUtils).to receive(:rm_rf)
34
+ allow(FileUtils).to receive(:cp_r)
35
+ expect(FileUtils).to receive(:remove_entry_secure).with("#{dest}/.git")
36
36
  subject.execute
37
37
  end
38
38
  end
@@ -10,8 +10,8 @@ describe Skynet::Builder do
10
10
  let(:args) { [:app, config] }
11
11
 
12
12
  it "initializes a new builder class" do
13
- described_class.should_receive(:const_get).with('Static').and_return mock_class
14
- mock_class.should_receive(:new).with(:app, config).and_return builder
13
+ expect(described_class).to receive(:const_get).with('Static').and_return(mock_class)
14
+ expect(mock_class).to receive(:new).with(:app, config).and_return(builder)
15
15
 
16
16
  described_class.for_app *args
17
17
  end
@@ -21,8 +21,8 @@ describe Skynet::Builder do
21
21
  let(:args) { [:app, config, :master] }
22
22
 
23
23
  it "calls build on the new builder" do
24
- described_class.stub(:for_app).and_return builder
25
- builder.should_receive(:build).with :master
24
+ allow(described_class).to receive(:for_app).and_return(builder)
25
+ expect(builder).to receive(:build).with(:master)
26
26
 
27
27
  described_class.build *args
28
28
  end
@@ -1,4 +1,6 @@
1
1
  require 'bundler/setup'
2
+ require 'active_model'
3
+ require 'shoulda-matchers'
2
4
 
3
5
  require 'skynet'
4
6
 
@@ -6,4 +8,15 @@ Skynet.logger = Logger.new File.join(File.dirname(__FILE__), 'test.log')
6
8
 
7
9
  RSpec.configure do |config|
8
10
  config.mock_with :rspec
11
+ config.expect_with :rspec
12
+ end
13
+
14
+ Shoulda::Matchers.configure do |config|
15
+ config.integrate do |with|
16
+ with.test_framework :rspec
17
+
18
+ # Keep as many of these lines as are necessary:
19
+ # with.library :active_record
20
+ with.library :active_model
21
+ end
9
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skynet-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Ahearn
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-26 00:00:00.000000000 Z
11
+ date: 2020-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -16,158 +16,158 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '2.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thin
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.4'
33
+ version: '1.7'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.4'
40
+ version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: json
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.7'
47
+ version: '2.3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.7'
54
+ version: '2.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: jekyll
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.5'
61
+ version: '4.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.5'
68
+ version: '4.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thor
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.16'
75
+ version: '1.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.16'
82
+ version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: activesupport
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '4.0'
89
+ version: '6.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '4.0'
96
+ version: '6.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: activemodel
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '4.0'
103
+ version: '6.0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '4.0'
110
+ version: '6.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: multi_json
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.0'
117
+ version: '1.15'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.0'
124
+ version: '1.15'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rake
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '10.2'
131
+ version: '13.0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '10.2'
138
+ version: '13.0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '2.11'
145
+ version: '3.9'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '2.11'
152
+ version: '3.9'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: shoulda-matchers
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '2.5'
159
+ version: '4.4'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '2.5'
166
+ version: '4.4'
167
167
  description: Sinatra app that listens for GitHub post-receive callbacks and deploys
168
168
  your code
169
169
  email:
170
- - ryan@coshx.com
170
+ - ryan.ahearn@hey.com
171
171
  executables:
172
172
  - skynet
173
173
  extensions: []
@@ -198,10 +198,10 @@ files:
198
198
  - spec/skynet/builder/static_spec.rb
199
199
  - spec/skynet/builder_spec.rb
200
200
  - spec/spec_helper.rb
201
- homepage: https://github.com/coshx/skynet
201
+ homepage: https://github.com/rahearn/skynet
202
202
  licenses: []
203
203
  metadata: {}
204
- post_install_message:
204
+ post_install_message:
205
205
  rdoc_options: []
206
206
  require_paths:
207
207
  - lib
@@ -209,16 +209,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
209
  requirements:
210
210
  - - ">="
211
211
  - !ruby/object:Gem::Version
212
- version: '0'
212
+ version: 2.7.1
213
213
  required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  requirements:
215
215
  - - ">="
216
216
  - !ruby/object:Gem::Version
217
- version: 1.3.6
217
+ version: '0'
218
218
  requirements: []
219
- rubyforge_project:
220
- rubygems_version: 2.2.0
221
- signing_key:
219
+ rubygems_version: 3.1.4
220
+ signing_key:
222
221
  specification_version: 4
223
222
  summary: Sinatra app that listens for GitHub post-receive callbacks and deploys your
224
223
  code