capistrano-scm-icopy 0.8.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
+ SHA256:
3
+ metadata.gz: dd8632c5916fc5e6bc0c25d8bcee1416fe6af23d2f4185274a33411cab51bd34
4
+ data.tar.gz: 219d8465a82b27e95df31bcc53fba3ee1766c881b36aa665182111dc67811c03
5
+ SHA512:
6
+ metadata.gz: 1dbf12f951471196cb62621e425e4394b9bb7def866365ad0b6755f24fd45f800aae5886f7c18441af9c87954b90a19153a75d993c4612d30b3eddcf479bebb8
7
+ data.tar.gz: 7ceabb7f197060906ef7b983533a177fa26d4ad34d4bd670fb2aa47223bc6f7cad275bdf41e9c594c2b284753eedc00427d3ff3ec3f6941c1a87c9a3f6d455e1
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
19
+
20
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
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,83 @@
1
+ capistrano-scm-copy
2
+ ===================
3
+
4
+ A copy strategy for Capistrano 3, which mimics the `:copy` scm of Capistrano 2.
5
+
6
+ This will make Capistrano tar the current directory, upload it to the server(s) and then extract it in the release directory.
7
+
8
+ Requirements
9
+ ============
10
+
11
+ Machine running Capistrano:
12
+
13
+ - Capistrano 3
14
+ - tar
15
+
16
+ Servers:
17
+
18
+ - mktemp
19
+ - tar
20
+
21
+ Installation
22
+ ============
23
+
24
+ First make sure you install the capistrano-scm-copy by adding it to your `Gemfile`:
25
+
26
+ gem "capistrano-scm-icopy"
27
+
28
+ Add to Capfile:
29
+
30
+ require 'capistrano/copy'
31
+
32
+ Then switch the `:scm` option to `:copy` in `config/deploy.rb`:
33
+
34
+ set :scm, :copy
35
+
36
+ TODO
37
+ ====
38
+
39
+ I'm new to programming for Capistrano and even Ruby in general. So any feedback is appreciated.
40
+
41
+ License
42
+ =======
43
+
44
+ The MIT License (MIT)
45
+
46
+ Changelog
47
+ =========
48
+
49
+ 0.5.0
50
+ -----
51
+
52
+ - Fix issue related to `tar_roles` (see wercker/capistrano-scm-copy#15)
53
+
54
+ 0.4.0
55
+ -----
56
+
57
+ - Add support for `tar_roles` (see wercker/capistrano-scm-copy#8)
58
+
59
+ 0.3.0
60
+ -----
61
+
62
+ - Fix issue when running on Mac OS X (see wercker/capistrano-scm-copy#9)
63
+ - Allow exclude directory to be an Array (see wercker/capistrano-scm-copy#9)
64
+
65
+ 0.2.0
66
+ -----
67
+
68
+ - Add `exclude_dir`
69
+
70
+ 0.1.0
71
+ -----
72
+
73
+ - Add `:include_dir`
74
+
75
+ 0.0.2
76
+ -----
77
+
78
+ - Add `task :set_current_revision`
79
+
80
+ 0.0.1
81
+ -----
82
+
83
+ - 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-icopy"
6
+ s.version = "0.8.0"
7
+ s.licenses = ["MIT"]
8
+ s.authors = ["JACK"]
9
+ s.email = ["tianlu1677@gmail.com"]
10
+ s.homepage = "https://github.com/tianlu1677/capistrano-scm-copy"
11
+ s.summary = %q{Copy strategy for capistrano 3.x}
12
+ s.description = %q{Copy 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.7.0"
21
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/copy.rake', __FILE__)
@@ -0,0 +1,58 @@
1
+ namespace :copy do
2
+
3
+ archive_name = "archive.tar.gz"
4
+
5
+ desc "Archive files to #{archive_name}"
6
+ task :create_archive do |t|
7
+ include_dir = fetch(:include_dir) || "*"
8
+ exclude_dir = Array(fetch(:exclude_dir))
9
+
10
+ exclude_args = exclude_dir.map { |dir| "--exclude '#{dir}'"}
11
+
12
+
13
+ # Defalut to :all roles
14
+ tar_roles = fetch(:tar_roles, :all)
15
+
16
+ tar_verbose = fetch(:tar_verbose, true) ? "v" : ""
17
+
18
+ file archive_name => FileList[include_dir].exclude(archive_name) do |t|
19
+ cmd = ["tar -c#{tar_verbose}zf #{t.name}", *exclude_args, *t.prerequisites]
20
+ sh cmd.join(' ')
21
+ end
22
+ end
23
+
24
+ desc "Deploy #{archive_name} to release_path"
25
+ task :deploy => archive_name do |t|
26
+ tarball = t.prerequisites.first
27
+
28
+ # Defalut to :all roles
29
+ tar_roles = fetch(:tar_roles, :all)
30
+
31
+ on roles(tar_roles) do
32
+ # Make sure the release directory exists
33
+ puts "==> release_path: #{release_path} is created on #{tar_roles} roles <=="
34
+ execute :mkdir, "-p", release_path
35
+
36
+ # Create a temporary file on the server
37
+ tmp_file = capture("mktemp")
38
+
39
+ # Upload the archive, extract it and finally remove the tmp_file
40
+ upload!(tarball, tmp_file)
41
+ execute :tar, "-xzf", tmp_file, "-C", release_path
42
+ execute :rm, tmp_file
43
+ end
44
+ end
45
+
46
+ task :clean do |t|
47
+ # Delete the local archive
48
+ File.delete archive_name if File.exists? archive_name
49
+ end
50
+
51
+ after 'deploy:finished', 'copy:clean'
52
+
53
+ task :create_release => :create_archive
54
+ task :create_release => :deploy
55
+ task :check
56
+ task :set_current_revision
57
+
58
+ end
File without changes
data/wercker.yml ADDED
@@ -0,0 +1,21 @@
1
+ box: wercker/rvm
2
+ build:
3
+ steps:
4
+ - bundle-install
5
+ - script:
6
+ name: build .gem
7
+ code: |-
8
+ gem build capistrano-scm-copy.gemspec
9
+ mv *.gem $WERCKER_OUTPUT_DIR/capistrano-scm-copy.gem
10
+ deploy:
11
+ steps:
12
+ - script:
13
+ name: login rubygems
14
+ code: |
15
+ export RUBYGEMS_CREDENTIALS_PATH=$HOME/.gem/credentials
16
+ touch $RUBYGEMS_CREDENTIALS_PATH
17
+ chmod 0600 $RUBYGEMS_CREDENTIALS_PATH
18
+ echo ":rubygems_api_key: $RUBYGEMS_API_KEY" > $RUBYGEMS_CREDENTIALS_PATH
19
+ - script:
20
+ name: publish .gem
21
+ code: gem push capistrano-scm-copy.gem
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-scm-icopy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0
5
+ platform: ruby
6
+ authors:
7
+ - JACK
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-09-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.7.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.7.0
27
+ description: Copy strategy for capistrano 3.x
28
+ email:
29
+ - tianlu1677@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-icopy.gemspec
40
+ - lib/capistrano-scm-icopy.rb
41
+ - lib/capistrano/copy.rb
42
+ - lib/capistrano/tasks/copy.rake
43
+ - wercker.yml
44
+ homepage: https://github.com/tianlu1677/capistrano-scm-copy
45
+ licenses:
46
+ - MIT
47
+ metadata: {}
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubygems_version: 3.1.6
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: Copy strategy for capistrano 3.x
67
+ test_files: []