capistrano-port_forwarding 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 39ccb3a725301c2d63372d7120ebc47b2d87d0bc08dfb08e87c7e18ee4a930be
4
+ data.tar.gz: a45cee2edc337b895b870e2c105f508081f3c73e6e6a1b7a1edecd71bf0d77e2
5
+ SHA512:
6
+ metadata.gz: 7fae6c6aab0f1b8aca1318cb57565a7febec01ef58bea553eca16a2090f8610684f6d601deeee4c815d37111693c11840fea1a019605d18b44edeab8ce071f26
7
+ data.tar.gz: c540535f093578edcaab80a67a9ff17187b0d43de89f7cbe9dfe33aedfb1480b6079f09ff90e20ef6f1d95c59db76041b85408627c21405880e7dedb2dbf2c12
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in capistrano-port_forwarding.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capistrano-port_forwarding (0.0.3)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.5.0)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 1.16)
16
+ capistrano-port_forwarding!
17
+ rake (~> 10.0)
18
+
19
+ BUNDLED WITH
20
+ 1.17.2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Yuji Kuroko
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # capistrano-port_forwarding
2
+
3
+ デプロイ先から社内npmを参照したり、GithubEnterpriseからデプロイを行う時用のgemです。
4
+ デプロイ先から見えないリポジトリを使ってデプロイできます。
5
+
6
+ ## Gemfile
7
+
8
+ ```ruby
9
+ gem 'capistrano-port_forwarding'
10
+ ```
11
+
12
+ ### Capfile
13
+
14
+ ```ruby
15
+ # capistrano < 3.7
16
+ require 'capistrano/deploy'
17
+ require 'capistrano/git'
18
+ require 'capistrano/port_forwarding'
19
+
20
+ # capistrano >= 3.7
21
+ require 'capistrano/deploy'
22
+ require 'capistrano/scm/git'
23
+ install_plugin Capistrano::SCM::Git
24
+ require 'capistrano/port_forwarding'
25
+ ```
26
+
27
+ ## 設定パラメータ(Settings)
28
+
29
+ ### ポートフォワーディング設定(Settings of port forwardings)
30
+
31
+ ```ruby
32
+ set :remote_forwards, [
33
+ '10022:repository.com:22', # git repo
34
+ ]
35
+ ```
36
+
37
+ ### その他設定(Settings of others)
38
+
39
+ ポートフォワードするので、各種設定も変わります。
40
+ ```ruby
41
+ set :repo_url, "ssh://git@127.0.0.1:10022/#{org_name}/#{repo_name}.git"
42
+ ```
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "capistrano/port_forwarding"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,34 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "capistrano/port_forwarding/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-port_forwarding"
8
+ spec.version = Capistrano::PortForwarding::VERSION
9
+ spec.authors = ["Yuji Kuroko"]
10
+ spec.email = [""]
11
+
12
+ spec.summary = %q{capistrano3 port forwarding settings.}
13
+ spec.description = %q{example: Able to deploy by repo on Github Enterprise.}
14
+ spec.homepage = "https://github.com/Yuji-Kuroko/capistrano-port_forwarding"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
+ else
21
+ raise "RubyGems 2.0 or newer is required to protect against " \
22
+ "public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(test|spec|features)/})
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.add_development_dependency "bundler", "~> 1.16"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ end
File without changes
@@ -0,0 +1,34 @@
1
+ require "capistrano/port_forwarding/version"
2
+
3
+ module Capistrano
4
+ module PortForwarding
5
+ # Your code goes here...
6
+ end
7
+ end
8
+
9
+ # examples
10
+ # set :remote_forwards, %w[10022:example.com:22]
11
+
12
+ # http://www.techscore.com/blog/2014/12/03/capistrano3でプライベートリポジトリからデプロイする/
13
+ namespace :port_forwarding do
14
+ task :remote_forwarding do
15
+ remote_forwards = fetch(:remote_forwards, [])
16
+ return if remote_forwards.empty?
17
+ on roles(:all) do
18
+ with_ssh do |ssh|
19
+ remote_forwards.each do |arg|
20
+ info " remote port forwarding #{arg} #{host}"
21
+ args = arg.split(':').reverse
22
+ args[0] = args[0].to_i if args[0]
23
+ args[2] = args[2].to_i if args[2]
24
+ ssh.forward.remote(*args)
25
+ end
26
+ ssh.exec!(':') #nop
27
+ ssh.loop
28
+ end
29
+ end
30
+ end
31
+ end
32
+ before 'deploy:starting', 'port_forwarding:remote_forwarding'
33
+ # deploy:check
34
+ before 'git:check', 'port_forwarding:remote_forwarding'
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module PortForwarding
3
+ VERSION = "0.0.3"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-port_forwarding
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Yuji Kuroko
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-07-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: 'example: Able to deploy by repo on Github Enterprise.'
42
+ email:
43
+ - ''
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - LICENSE
52
+ - README.md
53
+ - Rakefile
54
+ - bin/console
55
+ - bin/setup
56
+ - capistrano-port_forwarding.gemspec
57
+ - lib/capistrano-port_forwarding.rb
58
+ - lib/capistrano/port_forwarding.rb
59
+ - lib/capistrano/port_forwarding/version.rb
60
+ homepage: https://github.com/Yuji-Kuroko/capistrano-port_forwarding
61
+ licenses: []
62
+ metadata:
63
+ allowed_push_host: https://rubygems.org
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubygems_version: 3.0.4
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: capistrano3 port forwarding settings.
83
+ test_files: []