capistrano-scm-gitcopy 0.0.5
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 +15 -0
- data/.gitignore +20 -0
- data/Gemfile +3 -0
- data/LICENSE +20 -0
- data/README.md +38 -0
- data/Rakefile +0 -0
- data/capistrano-scm-gitcopy.gemspec +21 -0
- data/lib/capistrano-scm-gitcopy.rb +0 -0
- data/lib/capistrano/gitcopy.rb +1 -0
- data/lib/capistrano/tasks/gitcopy.rake +46 -0
- metadata +67 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NTlmNjNhZjY1YWE2ZWM4MTg2MjBjNGQ3OTBmZjkzZjE2NjljYWQ4ZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MzRjZTkyNDBkYmNhNGZmOGFmMTEzM2Q2NDc5YTY2YTNmMDQ0NmQ4Zg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YTE5NGJmZTllMzhhYzFmNGQ1Yjc0Y2FiNmE0YTZlYTA0OWNjNGZiMWJmMTkx
|
10
|
+
YmE5NzRlODMwNTlkMjYxN2I0M2ZhMzgxM2I2NDM3ODVjZmRiNDkzYWU5Yjk3
|
11
|
+
MTUxOGQ5MzY4OGM3MDgzNDdjOTgzN2U2ZGNkOWRkYmI4NjY5YmU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MjQ0OTU1MmNhOWVlZDU1M2MwMzdkZGY5MWJkOWZiNDA2NDYwZWRjNWJjMzdm
|
14
|
+
OTI3ZGRjZTNlNDRiNmE2ZjRiZGIxNzhiNWU5ODkxMmFlODhmOGUyN2NlMzYw
|
15
|
+
YjFlZTMwYjFjYWUzNWYyY2EzM2FlNmU3ZjYwMjcyOGM0ZDZhYmM=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 wercker
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
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, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
capistrano-scm-gitcopy
|
2
|
+
===================
|
3
|
+
|
4
|
+
A copy strategy for Capistrano 3, which mimics the `:copy` scm of Capistrano 2.
|
5
|
+
This Gem is inspired by and based on https://github.com/wercker/capistrano-scm-copy.
|
6
|
+
Thank wercker so much.
|
7
|
+
|
8
|
+
This will make Capistrano tar the a specific branch, upload it to the server(s) and then extract it in the release directory.
|
9
|
+
|
10
|
+
Requirements
|
11
|
+
============
|
12
|
+
|
13
|
+
Machine running Capistrano:
|
14
|
+
|
15
|
+
- Capistrano 3
|
16
|
+
- tar
|
17
|
+
|
18
|
+
Servers:
|
19
|
+
|
20
|
+
- mktemp
|
21
|
+
- tar
|
22
|
+
|
23
|
+
Installation
|
24
|
+
============
|
25
|
+
|
26
|
+
First make sure you install the capistrano-scm-gitcopy by adding it to your `Gemfile`:
|
27
|
+
|
28
|
+
gem "capistrano-scm-gitcopy"
|
29
|
+
|
30
|
+
Then switch the `:scm` option to `:gitcopy` in `config/deploy.rb`:
|
31
|
+
|
32
|
+
set :scm, :gitcopy
|
33
|
+
|
34
|
+
|
35
|
+
0.0.1
|
36
|
+
-----
|
37
|
+
|
38
|
+
- Initial release
|
data/Rakefile
ADDED
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "capistrano-scm-gitcopy"
|
6
|
+
s.version = "0.0.5"
|
7
|
+
s.licenses = ["MIT"]
|
8
|
+
s.authors = ["Jack Wu"]
|
9
|
+
s.email = ["xuwupeng2000@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/xuwupeng2000/capsitrano-scm-gitcopy.git"
|
11
|
+
s.summary = %q{Gitcopy strategy for capistrano 3.x}
|
12
|
+
s.description = %q{Gitcopy strategy for capistrano 3.x}
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
19
|
+
# specify any dependencies here; for example:
|
20
|
+
s.add_dependency "capistrano", "~> 3.0"
|
21
|
+
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/gitcopy.rake', __FILE__)
|
@@ -0,0 +1,46 @@
|
|
1
|
+
namespace :gitcopy do
|
2
|
+
|
3
|
+
archive_name = "archive.#{ DateTime.now.strftime('%Y%m%d%m%s') }.tar.gz"
|
4
|
+
include_dir = fetch(:include_dir) || "*"
|
5
|
+
exclude_dir = fetch(:exclude_dir) || ""
|
6
|
+
|
7
|
+
# Deploy specific branch in the following way:
|
8
|
+
# $ cap deploy -s branch=<the branch you want to deploy>
|
9
|
+
release_branch = ENV["branch"] || "master"
|
10
|
+
|
11
|
+
desc "Archive files to #{archive_name}"
|
12
|
+
file archive_name do |file|
|
13
|
+
system "git archive #{ fetch(:branch) } --format tar.gz --output #{ archive_name }"
|
14
|
+
end
|
15
|
+
|
16
|
+
desc "Deploy #{archive_name} to release_path"
|
17
|
+
task :deploy => archive_name do |file|
|
18
|
+
tarball = file.prerequisites.first
|
19
|
+
on roles :all do
|
20
|
+
# Make sure the release directory exists
|
21
|
+
execute :mkdir, "-p", release_path
|
22
|
+
|
23
|
+
# Create a temporary file on the server
|
24
|
+
tmp_file = capture("mktemp")
|
25
|
+
|
26
|
+
# Upload the archive, extract it and finally remove the tmp_file
|
27
|
+
upload!(tarball, tmp_file)
|
28
|
+
execute :tar, "-xzf", tmp_file, "-C", release_path
|
29
|
+
execute :rm, tmp_file
|
30
|
+
end
|
31
|
+
|
32
|
+
Rake::Task["gitcopy:clean"].invoke
|
33
|
+
end
|
34
|
+
|
35
|
+
task :clean do |t|
|
36
|
+
# Delete the local archive
|
37
|
+
File.delete archive_name if File.exists? archive_name
|
38
|
+
end
|
39
|
+
|
40
|
+
task :create_release => :deploy
|
41
|
+
|
42
|
+
task :check
|
43
|
+
|
44
|
+
task :set_current_revision
|
45
|
+
|
46
|
+
end
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-scm-gitcopy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jack Wu
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-09-23 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
|
+
description: Gitcopy strategy for capistrano 3.x
|
28
|
+
email:
|
29
|
+
- xuwupeng2000@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- .gitignore
|
35
|
+
- Gemfile
|
36
|
+
- LICENSE
|
37
|
+
- README.md
|
38
|
+
- Rakefile
|
39
|
+
- capistrano-scm-gitcopy.gemspec
|
40
|
+
- lib/capistrano-scm-gitcopy.rb
|
41
|
+
- lib/capistrano/gitcopy.rb
|
42
|
+
- lib/capistrano/tasks/gitcopy.rake
|
43
|
+
homepage: https://github.com/xuwupeng2000/capsitrano-scm-gitcopy.git
|
44
|
+
licenses:
|
45
|
+
- MIT
|
46
|
+
metadata: {}
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options: []
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements: []
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 2.2.2
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: Gitcopy strategy for capistrano 3.x
|
67
|
+
test_files: []
|