capistrano-scm-git_with_submodule_and_resolv_symlinks 0.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 16aa3914ff514f7db22ef0f1ea15e41ceddf1c6c
4
+ data.tar.gz: 669defcc9b24676f398c6a455a7190fefb75d8d5
5
+ SHA512:
6
+ metadata.gz: b7fc0fba07b1e85eae094d1b1113de2fa6e43a6000804cb5b6388817b6b33f23dd0643143067ee76a571ebf1b356b42515e94042130bd6a46f93efb572673a56
7
+ data.tar.gz: 07f6c1c6915b7573bce21ce7e820b83ca2ecddf79e977fa2674f01c83832c3d060a2962ba870ce424a6bc81a1e329cf987294227f334db9c3627154ce0139a26
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /vendor/bundle
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.3
5
+ before_install: gem install bundler -v 1.12.5
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 YAMADA Tsuyoshi
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,38 @@
1
+ # capistrano-scm-git_with_submodule_and_resolv_symlinks
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/capistrano-scm-git_with_submodule_and_resolv_symlinks.png)](https://rubygems.org/gems/capistrano-scm-git_with_submodule_and_resolv_symlinks) [![Build Status](https://secure.travis-ci.org/groovenauts/capistrano-scm-git_with_submodule_and_resolv_symlinks.png)](https://travis-ci.org/groovenauts/capistrano-scm-git_with_submodule_and_resolv_symlinks)
4
+
5
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capistrano/scm/git_with_submodule_and_resolv_symlinks.rb`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ TODO: Delete this and the text above, and describe your gem
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'capistrano-scm-git_with_submodule_and_resolv_symlinks'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install capistrano-scm-git_with_submodule_and_resolv_symlinks
24
+
25
+ ## Usage
26
+
27
+ TODO: Write usage instructions here
28
+
29
+ ## Development
30
+
31
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+
33
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+
35
+ ## Contributing
36
+
37
+ Bug reports and pull requests are welcome on GitHub at https://github.com/groovenauts/capistrano-scm-git_with_submodule_and_resolv_symlinks.
38
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "capistrano/scm/git_with_submodule_and_resolv_symlink"
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
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,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/scm/git_with_submodule_and_resolv_symlinks/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-scm-git_with_submodule_and_resolv_symlinks"
8
+ spec.version = Capistrano::SCM::GitWithSubmoduleAndResolvSymlinks::VERSION
9
+ spec.authors = ["YAMADA Tsuyoshi"]
10
+ spec.email = ["tsu-yamada@groovenauts.jp"]
11
+
12
+ spec.summary = %q{Capistrano Git SCM Plugin with submodule and resolving symlink}
13
+ spec.description = %q{Capistrano Git SCM Plugin with submodule and resolving symlink}
14
+ spec.homepage = "https://github.com/groovenauts/capistrano-scm-git_with_submodule_and_resolv_symlinks"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_dependency "capistrano", "~> 3.7.0.beta1"
23
+ spec.add_development_dependency "bundler", "~> 1.12"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.0"
26
+ spec.add_development_dependency "mocha", "~> 1.2"
27
+ end
@@ -0,0 +1,81 @@
1
+ require 'capistrano/scm/plugin'
2
+ require 'capistrano/scm/git_with_submodule_and_resolv_symlinks/version'
3
+
4
+ module Capistrano
5
+ class SCM
6
+ class GitWithSubmoduleAndResolvSymlinks < ::Capistrano::SCM::Plugin
7
+ def nsp
8
+ "git_with_submodule_and_resolv_symlinks"
9
+ end
10
+
11
+ def set_defaults
12
+ set_if_empty :"#{nsp}_wrapper_path", lambda {
13
+ # Try to avoid permissions issues when multiple users deploy the same app
14
+ # by using different file names in the same dir for each deployer and stage.
15
+ suffix = [:application, :stage, :local_user].map { |key| fetch(key).to_s }.join("-").gsub(/\s+/, "-")
16
+ "#{fetch(:tmp_dir)}/git-ssh-#{suffix}.sh"
17
+ }
18
+ set_if_empty :"#{nsp}_environmental_variables", lambda {
19
+ {
20
+ :"#{nsp}_askpass" => "/bin/echo",
21
+ :"#{nsp}_ssh" => fetch(:"#{nsp}_wrapper_path")
22
+ }
23
+ }
24
+ end
25
+
26
+ def register_hooks
27
+ nsp = "git_with_submodule_and_resolv_symlinks"
28
+ after "deploy:new_release_path", "#{nsp}:create_release"
29
+ before "deploy:check", "#{nsp}:check"
30
+ before "deploy:set_current_revision", "#{nsp}:set_current_revision"
31
+ end
32
+
33
+ def define_tasks
34
+ eval_rakefile File.expand_path("../tasks/git_with_submodule_and_resolv_symlinks.rake", __FILE__)
35
+ end
36
+
37
+ def repo_mirror_exists?
38
+ backend.test " [ -d #{repo_path}/.git ] "
39
+ end
40
+
41
+ def check_repo_is_reachable
42
+ git :'ls-remote', repo_url, "HEAD"
43
+ end
44
+
45
+ def clone_repo
46
+ git :clone, repo_url, repo_path.to_s
47
+ end
48
+
49
+ def update_mirror
50
+ git :remote, :update, "--prune"
51
+ git :checkout, "--detach", real_branch
52
+ git :submodule, :update, "--init"
53
+ end
54
+
55
+ def release
56
+ if fetch(:repo_tree)
57
+ backend.execute "rsync -ar --copy-links --exclude=.git\* #{repo_path}/#{fetch(:repo_tree)}/ #{release_path}"
58
+ else
59
+ backend.execute "rsync -ar --copy-links --exclude=.git\* #{repo_path}/ #{release_path}"
60
+ end
61
+ end
62
+
63
+ def fetch_revision
64
+ backend.capture(:git, "rev-list", "--max-count=1", "--abbrev-commit", real_branch)
65
+ end
66
+
67
+ def real_branch
68
+ @real_branch ||= if backend.test(:git, :"rev-parse", fetch(:branch))
69
+ fetch(:branch)
70
+ else
71
+ "origin/#{fetch(:branch)}"
72
+ end
73
+ end
74
+
75
+ def git(*args)
76
+ args.unshift :git
77
+ backend.execute(*args)
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,19 @@
1
+ begin
2
+ require 'capistrano/scm/plugin'
3
+ rescue LoadError
4
+ module Capistrano
5
+ class Plugin; end
6
+ class SCM
7
+ class Plugin < ::Capistrano::Plugin
8
+ end
9
+ end
10
+ end
11
+ end
12
+
13
+ module Capistrano
14
+ class SCM
15
+ class GitWithSubmoduleAndResolvSymlinks < ::Capistrano::SCM::Plugin
16
+ VERSION = "0.1.0.beta1"
17
+ end
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-scm-git_with_submodule_and_resolv_symlinks
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.beta1
5
+ platform: ruby
6
+ authors:
7
+ - YAMADA Tsuyoshi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.7.0.beta1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.7.0.beta1
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.12'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.12'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mocha
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.2'
83
+ description: Capistrano Git SCM Plugin with submodule and resolving symlink
84
+ email:
85
+ - tsu-yamada@groovenauts.jp
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
+ - Gemfile
94
+ - LICENSE
95
+ - README.md
96
+ - Rakefile
97
+ - bin/console
98
+ - bin/setup
99
+ - capistrano-scm-git_with_submodule_and_resolv_symlinks.gemspec
100
+ - lib/capistrano/scm/git_with_submodule_and_resolv_symlinks.rb
101
+ - lib/capistrano/scm/git_with_submodule_and_resolv_symlinks/version.rb
102
+ homepage: https://github.com/groovenauts/capistrano-scm-git_with_submodule_and_resolv_symlinks
103
+ licenses:
104
+ - MIT
105
+ metadata: {}
106
+ post_install_message:
107
+ rdoc_options: []
108
+ require_paths:
109
+ - lib
110
+ required_ruby_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">"
118
+ - !ruby/object:Gem::Version
119
+ version: 1.3.1
120
+ requirements: []
121
+ rubyforge_project:
122
+ rubygems_version: 2.5.2
123
+ signing_key:
124
+ specification_version: 4
125
+ summary: Capistrano Git SCM Plugin with submodule and resolving symlink
126
+ test_files: []