capistrano-gitcopy 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +51 -0
- data/Rakefile +14 -0
- data/lib/capistrano/gitcopy.rb +1 -0
- data/lib/capistrano/tasks/gitcopy.rake +44 -0
- data/lib/gitcopy.rb +0 -0
- metadata +78 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1741d01b98d0f6089c3db7e30bf64273987b333a
|
4
|
+
data.tar.gz: 1aca3c96da1b21e228d1d2b9eb6905fbb0ec6ee7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b432ca9d23f9b7f6bb90b33ee8716a67fbd3730aee00ae36f7a299c6f8d151143fa76a90f5869a9c24effc60898ed61cdb35aa9725ad4a779f87e1ba14d7d0f0
|
7
|
+
data.tar.gz: e0d586a4a9a10d00df8b780a5e2efb5512e32de1e7d2b949ee12ca37d71d54fe184071af1042132d4b622b23d16720dd8910392bf673a1c943f68691d7fe72a3
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# Capistrano::GitCopy
|
2
|
+
|
3
|
+
This gem provides the GitCopy SCM strategy for Capistrano v3. It creates an archive locally (from git), uploads to the
|
4
|
+
server, unpacks and creates the release as usual. This avoids having to manage deploy keys on your server nor
|
5
|
+
connectivity from the server to the git repository. This is particular useful for private git repos and codebases.
|
6
|
+
|
7
|
+
## Notes
|
8
|
+
|
9
|
+
**If you use this integration with capistrano-rails, please ensure that you have `capistrano-bundler >= 1.1.0`.**
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
``` ruby
|
16
|
+
# Gemfile
|
17
|
+
gem 'capistrano', '~> 3.0'
|
18
|
+
gem 'capistrano-gitcopy'
|
19
|
+
```
|
20
|
+
|
21
|
+
And then execute:
|
22
|
+
|
23
|
+
``` sh
|
24
|
+
$ bundle install
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
Require in Capfile to use the default task:
|
30
|
+
|
31
|
+
``` ruby
|
32
|
+
# Capfile
|
33
|
+
require 'capistrano/gitcopy'
|
34
|
+
```
|
35
|
+
|
36
|
+
On your deploy.rb change the scm strategy:
|
37
|
+
|
38
|
+
``` ruby
|
39
|
+
set :scm, :gitcopy
|
40
|
+
```
|
41
|
+
|
42
|
+
And you should be good to go!
|
43
|
+
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
1. Fork it
|
48
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
49
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
50
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
51
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'bundler/setup'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'bundler/gem_tasks'
|
10
|
+
|
11
|
+
require 'rspec/core'
|
12
|
+
require 'rspec/core/rake_task'
|
13
|
+
|
14
|
+
task default: :spec
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../tasks/gitcopy.rake", __FILE__)
|
@@ -0,0 +1,44 @@
|
|
1
|
+
namespace :load do
|
2
|
+
task :defaults do
|
3
|
+
set(:gitcopy_release_id, -> { `git rev-parse --short HEAD`.gsub(/\n/,'') })
|
4
|
+
set(:gitcopy_tarball_path, -> { "/tmp/#{fetch(:application)}-#{fetch(:gitcopy_release_id)}.tar.gz" })
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
namespace :gitcopy do
|
9
|
+
task :wrapper do; end
|
10
|
+
task :check do; end
|
11
|
+
task :update do; end
|
12
|
+
|
13
|
+
task :test do
|
14
|
+
on release_roles(:web) do
|
15
|
+
test!(" [ -f #{fetch(:gitcopy_tarball_path)} ] ")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
task :clone do
|
20
|
+
on release_roles(:web) do
|
21
|
+
tarball_path = fetch(:gitcopy_tarball_path)
|
22
|
+
system("git archive -o #{tarball_path} HEAD")
|
23
|
+
upload!(tarball_path, tarball_path)
|
24
|
+
system("rm -rf #{tarball_path}")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
task create_release: :'gitcopy:clone' do
|
29
|
+
on release_roles(:web) do
|
30
|
+
execute(:mkdir, '-p', release_path)
|
31
|
+
execute(:tar, '-f', fetch(:gitcopy_tarball_path), '-x -C', release_path)
|
32
|
+
# execute(:rm, '-f', fetch(:gitcopy_tarball_path))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
task :set_current_revision do
|
37
|
+
on release_roles(:web) do
|
38
|
+
set :current_revision, fetch(:gitcopy_release_id)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
task :cleanup do; end
|
43
|
+
end
|
44
|
+
|
data/lib/gitcopy.rb
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-gitcopy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andre Dieb Martins
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-07 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.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sshkit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.2'
|
41
|
+
description: Deploy by creating a tarball using git archive and uploading it to the
|
42
|
+
server. No access/credentials from your server to the Git repo required.
|
43
|
+
email:
|
44
|
+
- andre.dieb@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- README.md
|
50
|
+
- Rakefile
|
51
|
+
- lib/capistrano/gitcopy.rb
|
52
|
+
- lib/capistrano/tasks/gitcopy.rake
|
53
|
+
- lib/gitcopy.rb
|
54
|
+
homepage: https://github.com/dieb/capistrano-gitcopy
|
55
|
+
licenses:
|
56
|
+
- MIT
|
57
|
+
metadata: {}
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options: []
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
requirements: []
|
73
|
+
rubyforge_project:
|
74
|
+
rubygems_version: 2.4.3
|
75
|
+
signing_key:
|
76
|
+
specification_version: 4
|
77
|
+
summary: ''
|
78
|
+
test_files: []
|