capistrano-scm-strategy 0.1.0

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: fc5a4c3aadd91b61e9a0ee25130fdef284f56630
4
+ data.tar.gz: 1ea0e2f277e6e767182c6fa054861e2a3c9cc171
5
+ SHA512:
6
+ metadata.gz: a3222964f49a38fbef9eb36dd000611106b578d08eadd8e285206f12cf20badc262157ac585c8316e398f8cb51fe7bb7d1b91d5039ce7f30cdaeadea15d8d4d2
7
+ data.tar.gz: d59f9cd8c285d7618d8727f6c316eee39320c62cfee1393e81df450651a05ad44b8a1000b9c0fed6262d9948df5068bb833145d0d225534c1daefc7f1b015659
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ /.bundle/
4
+ /.config
5
+ /.yardoc/
6
+ /Gemfile.lock
7
+ /InstalledFiles
8
+ /_yardoc/
9
+ /coverage/
10
+ /doc/
11
+ /lib/bundler/man/
12
+ /pkg/
13
+ /rdoc/
14
+ /spec/reports/
15
+ /test/tmp/
16
+ /test/version_tmp/
17
+ /tmp/
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ capistrano-scm-strategy
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.1.1
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Capistrano SCM Strategy Changelog
2
+
3
+ This changelog documents the main changes between released versions.
4
+ For a full list of changes, consult the commit history.
5
+
6
+
7
+ ## 0.1.0
8
+
9
+ - first release!
10
+ - new sparse Git strategy (`Git::Sparse`)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-scm-strategy.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 tiredpixel
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # Capistrano SCM Strategy
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/capistrano-scm-strategy.png)](http://badge.fury.io/rb/capistrano-scm-strategy)
4
+ [![Code Climate](https://codeclimate.com/github/tiredpixel/capistrano-scm-strategy.png)](https://codeclimate.com/github/tiredpixel/capistrano-scm-strategy)
5
+
6
+ [Capistrano](http://capistranorb.com/) SCM strategies (sparse).
7
+
8
+ Capistrano SCM Strategy is a home for additional strategies utilising
9
+ Capistrano's pluggable strategy approach. Only Capistrano 3 is supported.
10
+ Currently, the only strategy is `Git::Sparse`. But why not blend your magic? :)
11
+
12
+ More sleep lost by [tiredpixel](http://www.tiredpixel.com).
13
+
14
+
15
+ ## Installation
16
+
17
+ Install using:
18
+
19
+ gem 'capistrano-scm-strategy', '~> 0.1'
20
+
21
+ The default Ruby version supported is defined in `.ruby-version`.
22
+
23
+
24
+ ## Usage
25
+
26
+ Require all strategies (they are namespaced so don't fret :) ):
27
+
28
+ # Capfile
29
+
30
+ require 'capistrano/scm/strategy'
31
+
32
+ Choose a strategy using Capistrano's pluggable nature:
33
+
34
+ set :git_strategy, Capistrano::Scm::Strategy::Git::Sparse
35
+
36
+ The strategy option is named `:SCM_strategy`, where `SCM` is the SCM set or
37
+ defaulted by `:scm`. So, for Subversion, use `:svn_strategy`.
38
+
39
+ That's it!
40
+
41
+
42
+ ## Strategies
43
+
44
+ These strategies are available:
45
+
46
+ - `Capistrano::Scm::Strategy::Git::Sparse` :
47
+ A sparse Git strategy.
48
+
49
+
50
+ ## Stay Tuned
51
+
52
+ We have a [Librelist](http://librelist.com) mailing list!
53
+ To subscribe, send an email to <capistrano.scm.strategy@librelist.com>.
54
+ To unsubscribe, send an email to <capistrano.scm.strategy-unsubscribe@librelist.com>.
55
+ There be [archives](http://librelist.com/browser/capistrano.scm.strategy/).
56
+ That was easy.
57
+
58
+ You can also become a [watcher](https://github.com/tiredpixel/capistrano-scm-strategy/watchers)
59
+ on GitHub. And don't forget you can become a [stargazer](https://github.com/tiredpixel/capistrano-scm-strategy/stargazers) if you are so minded. :D
60
+
61
+
62
+ ## Growing Like Flowers
63
+
64
+ Dear Me, Here is a vague wishlist:
65
+
66
+ - `Capistrano::Scm::Strategy::Hg::Sparse` :
67
+ A sparse Mercurial strategy.
68
+
69
+ - `Capistrano::Scm::Strategy::Svn::Sparse` :
70
+ A sparse Subversion strategy.
71
+
72
+ Also take a look at the [issue tracker](https://github.com/tiredpixel/capistrano-scm-strategy/issues).
73
+
74
+
75
+ ## Contributions
76
+
77
+ Contributions are embraced with much love and affection!
78
+ Please fork the repository and wizard your magic.
79
+ Then send me a pull request. Simples!
80
+ If you'd like to discuss what you're doing or planning to do, or if you get
81
+ stuck on something, then just wave. :)
82
+
83
+ Do whatever makes you happy. We'll probably still like you. :)
84
+
85
+
86
+ ## Blessing
87
+
88
+ May you find peace, and help others to do likewise.
89
+
90
+
91
+ ## Licence
92
+
93
+ © [tiredpixel](http://www.tiredpixel.com) 2014.
94
+ It is free software, released under the MIT License, and may be redistributed
95
+ under the terms specified in `LICENSE`.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
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/strategy/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-scm-strategy"
8
+ spec.version = Capistrano::Scm::Strategy::VERSION
9
+ spec.authors = ["tiredpixel"]
10
+ spec.email = ["tp@tiredpixel.com"]
11
+ spec.summary = %q{Capistrano SCM strategies (sparse).}
12
+ spec.description = %q{}
13
+ spec.homepage = "https://github.com/tiredpixel/capistrano-scm-strategy"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'capistrano', '~> 3.1'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake"
25
+ end
@@ -0,0 +1,60 @@
1
+ require 'capistrano/git'
2
+
3
+
4
+ # A sparse Git strategy for Capistrano.
5
+ # SEE: Capistrano::Git::DefaultStrategy
6
+ module Capistrano
7
+ module Scm
8
+ module Strategy
9
+ module Git
10
+ module Sparse
11
+
12
+ def test
13
+ test! " [ -f #{repo_path}/HEAD ] "
14
+ end
15
+
16
+ def check
17
+ test! :git, :'ls-remote -h', repo_url
18
+ end
19
+
20
+ def clone
21
+ # clone bare repo, but only latest commit of some branch
22
+ git(
23
+ :clone,
24
+ '--bare',
25
+ '--depth 1',
26
+ "--branch #{fetch(:branch)}",
27
+ repo_url,
28
+ repo_path
29
+ )
30
+ end
31
+
32
+ def update
33
+ # update branch, checking out a new branch if :branch changed
34
+ # --force is used to skip inheritance check when new commits
35
+ git(
36
+ :fetch,
37
+ '--depth 1',
38
+ '--force',
39
+ 'origin',
40
+ "#{fetch(:branch)}:#{fetch(:branch)}"
41
+ )
42
+
43
+ # update HEAD to reflect correct branch for manual inspection
44
+ # shouldn't strictly be needed as branch is explicit elsewhere
45
+ git(:'symbolic-ref', 'HEAD', "refs/heads/#{fetch(:branch)}")
46
+ end
47
+
48
+ def release
49
+ git :archive, fetch(:branch), '| tar -x -C', release_path
50
+ end
51
+
52
+ def fetch_revision
53
+ context.capture(:git, "rev-parse #{fetch(:branch)}")
54
+ end
55
+
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,9 @@
1
+ module Capistrano
2
+ module Scm
3
+ module Strategy
4
+
5
+ VERSION = '0.1.0'.freeze
6
+
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ require 'capistrano/scm/strategy/version'
2
+
3
+ require 'capistrano/scm/strategy/git/sparse'
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-scm-strategy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - tiredpixel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-16 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.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
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.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: ''
56
+ email:
57
+ - tp@tiredpixel.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".ruby-gemset"
64
+ - ".ruby-version"
65
+ - CHANGELOG.md
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - capistrano-scm-strategy.gemspec
71
+ - lib/capistrano/scm/strategy.rb
72
+ - lib/capistrano/scm/strategy/git/sparse.rb
73
+ - lib/capistrano/scm/strategy/version.rb
74
+ homepage: https://github.com/tiredpixel/capistrano-scm-strategy
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Capistrano SCM strategies (sparse).
98
+ test_files: []