capistrano-locally 0.2.1 → 0.2.7

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: b02ccd484763f78efb6669f111d9e5c6a08a6832
4
- data.tar.gz: 28638978f8101ebdf6d9e2a2b03da8807b2aaf6b
2
+ SHA256:
3
+ metadata.gz: 6e833304cd9224ff0e9e5a12c394f7422cf69738bd42f7ab1062cceb44121b70
4
+ data.tar.gz: 354d9e14248d7d796a122b38d1c31045c90cfcba20d781fc8948a0d1f9da291a
5
5
  SHA512:
6
- metadata.gz: 537b9be25aa7b73d334abbecbde10381319b22a03551336ae4b690999781e2fc95fd8f8ac2d3fa528af6fbfb70716c7ea7a063ff08488fcc25f89a502d8207f0
7
- data.tar.gz: 6494aee63653ce939eb06da0e74a05161cfce6b041e45082e7afdafa60cef1b1a6e095a76b31f6dfcd528b0c77259202e5d8d387e39b350dc3c45dc8e83f6121
6
+ metadata.gz: 5700767f88d92d52b85bb918db4cef974276935f3d59ef5b94e0b5c19606b6d2d48552bc873c8da7ef86aa0bb5ad98acfa21b402b4c5e728d43a37eac2b1dcfc
7
+ data.tar.gz: ea93f72cf41dd6bd3939169cca25e0fa5a053af114a03e225fa45ffb87b34d6a6edbb26b7592ec376e7a97a26c919ade4f8cf5b1dd7db94c56fd6c50cc668f4d
@@ -0,0 +1,64 @@
1
+ # Ruby CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
+ #
5
+ version: 2
6
+ jobs:
7
+ build:
8
+ docker:
9
+ # specify the version you desire here
10
+ - image: circleci/ruby:2.4.1-node-browsers
11
+ - image: circleci/ruby:2.5.3-node-browsers
12
+
13
+ # Specify service dependencies here if necessary
14
+ # CircleCI maintains a library of pre-built images
15
+ # documented at https://circleci.com/docs/2.0/circleci-images/
16
+ # - image: circleci/postgres:9.4
17
+
18
+ working_directory: ~/repo
19
+
20
+ steps:
21
+ - checkout
22
+
23
+ # Download and cache dependencies
24
+ - restore_cache:
25
+ keys:
26
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
27
+ # fallback to using the latest cache if no exact match is found
28
+ - v1-dependencies-
29
+
30
+ - run:
31
+ name: install dependencies
32
+ command: |
33
+ bundle install --jobs=4 --retry=3 --path vendor/bundle
34
+
35
+ - save_cache:
36
+ paths:
37
+ - ./vendor/bundle
38
+ key: v1-dependencies-{{ checksum "Gemfile.lock" }}
39
+
40
+ # # Database setup
41
+ # - run: bundle exec rake db:create
42
+ # - run: bundle exec rake db:schema:load
43
+
44
+ # run tests!
45
+ - run:
46
+ name: run tests
47
+ command: |
48
+ mkdir /tmp/test-results
49
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
50
+ circleci tests split --split-by=timings)"
51
+
52
+ bundle exec rspec \
53
+ --format progress \
54
+ --format RspecJunitFormatter \
55
+ --out /tmp/test-results/rspec.xml \
56
+ --format progress \
57
+ $TEST_FILES
58
+
59
+ # collect reports
60
+ - store_test_results:
61
+ path: /tmp/test-results
62
+ - store_artifacts:
63
+ path: /tmp/test-results
64
+ destination: test-results
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /vendor/
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Takuto Komazaki
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Capistrano::Locally
2
+ [![CircleCI](https://circleci.com/gh/komazarari/capistrano-locally.svg?style=svg)](https://circleci.com/gh/komazarari/capistrano-locally)
2
3
 
3
4
  This gem is a Capistrano plugin to simplify "localhost" deployment.
4
5
 
@@ -14,7 +15,7 @@ So, you don't need to write SSH user and configs on `server 'localhost'`.
14
15
  Add this line to your application's Gemfile:
15
16
 
16
17
  ```ruby
17
- gem 'capistrano-locally'
18
+ gem 'capistrano-locally', require: false
18
19
  ```
19
20
 
20
21
  And then execute:
@@ -37,10 +38,14 @@ Require in `Capfile`:
37
38
  `config/deploy/staging_and_local.rb`
38
39
 
39
40
  # typically server config is:
40
- server 'my.remotehost.com', roles: w%{app web}, user: 'deploy', key: '/path/to/key.pem'
41
+ server 'my.remotehost.com', roles: %w{app web}, user: 'deploy', key: '/path/to/key.pem'
41
42
  # localhost config is:
42
- server 'localhost', roles: w%{app web} # no need to set SSH configs.
43
+ server 'localhost', roles: %w{app web} # no need to set SSH configs.
43
44
 
45
+ ### Options
46
+ **`:run_locally_with_clean_env`** (default: `true`)
47
+
48
+ When using bundler, commands are executed in `Bundler.with_clean_env` by default so as not to affect the executable ruby scripts. To explicitly inherit environment variables, set this `false`.
44
49
 
45
50
  ## Development
46
51
 
@@ -52,3 +57,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
52
57
 
53
58
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/capistrano-locally.
54
59
 
60
+ ## License
61
+
62
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -19,6 +19,7 @@ But when limiting to some simple case that deployment to localhost, SSH isn't so
19
19
  A `capistrano-locally` deploys without SSH only when a target host named "localhost".
20
20
  EOS
21
21
  spec.homepage = "https://github.com/komazarari/capistrano-locally"
22
+ spec.license = "MIT"
22
23
 
23
24
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
25
  spec.bindir = "exe"
@@ -27,7 +28,8 @@ A `capistrano-locally` deploys without SSH only when a target host named "localh
27
28
 
28
29
  spec.add_dependency "capistrano", "~> 3.0"
29
30
 
30
- spec.add_development_dependency "bundler", "~> 1.10"
31
+ spec.add_development_dependency "bundler"
31
32
  spec.add_development_dependency "rake", "~> 10.0"
32
33
  spec.add_development_dependency "rspec"
34
+ spec.add_development_dependency "rspec_junit_formatter"
33
35
  end
@@ -13,21 +13,29 @@ module Capistrano
13
13
 
14
14
  def on(hosts, options={}, &block)
15
15
  return unless hosts
16
- localhosts, remotehosts = hosts.partition { |h| h.hostname.to_s == 'localhost' }
16
+ localhosts, remotehosts = Array(hosts).partition { |h| h.hostname.to_s == 'localhost' }
17
17
  localhost = Configuration.env.filter(localhosts).first
18
18
 
19
19
  unless localhost.nil?
20
- if dry_run?
21
- SSHKit::Backend::Printer
20
+ klass = if dry_run?
21
+ SSHKit::Backend::Printer
22
+ else
23
+ SSHKit::Backend::Local
24
+ end
25
+ if (defined? Bundler) && fetch(:run_locally_with_clean_env, true)
26
+ Bundler.with_clean_env do
27
+ klass.new(localhost, &block).run
28
+ end
22
29
  else
23
- SSHKit::Backend::Local
24
- end.new(localhost, &block).run
30
+ klass.new(localhost, &block).run
31
+ end
25
32
  end
26
33
 
27
- original_on(remotehosts, options={}, &block)
34
+ original_on(remotehosts, options, &block)
28
35
  end
29
36
 
30
37
  private
38
+
31
39
  def dry_run?
32
40
  fetch(:sshkit_backend) == SSHKit::Backend::Printer
33
41
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Locally
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-locally
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuto Komazaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-23 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.10'
33
+ version: '0'
34
34
  type: :development
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.10'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec_junit_formatter
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: |
70
84
  Capistrano plugin to simplify "localhost" deployment.
71
85
 
@@ -79,9 +93,11 @@ executables: []
79
93
  extensions: []
80
94
  extra_rdoc_files: []
81
95
  files:
96
+ - ".circleci/config.yml"
82
97
  - ".gitignore"
83
98
  - ".rspec"
84
99
  - Gemfile
100
+ - LICENSE.txt
85
101
  - README.md
86
102
  - Rakefile
87
103
  - bin/console
@@ -90,7 +106,8 @@ files:
90
106
  - lib/capistrano/locally.rb
91
107
  - lib/capistrano/locally/version.rb
92
108
  homepage: https://github.com/komazarari/capistrano-locally
93
- licenses: []
109
+ licenses:
110
+ - MIT
94
111
  metadata: {}
95
112
  post_install_message:
96
113
  rdoc_options: []
@@ -107,8 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
124
  - !ruby/object:Gem::Version
108
125
  version: '0'
109
126
  requirements: []
110
- rubyforge_project:
111
- rubygems_version: 2.4.5.1
127
+ rubygems_version: 3.1.4
112
128
  signing_key:
113
129
  specification_version: 4
114
130
  summary: Capistrano plugin to simplify "localhost" deployment.