capistrano-scm-makecopy 0.8.4

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 50300f61a701b9617cd34caa17bd55b63cdabbf98e2f6c3e5c1d10637a2febab
4
+ data.tar.gz: 05c9d92764e09c077ea9603298d34f0b6a4231b60374441cc8e6d691dc49b94b
5
+ SHA512:
6
+ metadata.gz: 3900cdc57d912d20bfe0ae762ccea27f0d4d0c4a190c85831562c089258289dc486340b56434bc8d12a8b70692bfb8e23c56fde95fe70b7431c2a1d016977553
7
+ data.tar.gz: 721ad49cff9b65b7f8ece2bc90fa407878f18542a1b8bd7b5240eb7b3b5db549dfe2a9e0b943cd256e49e087753049e2924d2ffd02baa0db67dff37c847c864c
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/CONTRIBUTING.md ADDED
@@ -0,0 +1,45 @@
1
+ # Contributing
2
+
3
+ Oracle welcomes contributions to this repository from anyone.
4
+
5
+ If you want to submit a pull request to fix a bug or enhance an existing
6
+ feature, please first open an issue and link to that issue when you
7
+ submit your pull request.
8
+
9
+ If you have any questions about a possible submission, feel free to open
10
+ an issue too.
11
+
12
+ ## Contributing to this repository
13
+
14
+ Pull requests can be made under
15
+ [The Oracle Contributor Agreement](https://www.oracle.com/technetwork/community/oca-486395.html) (OCA).
16
+
17
+ For pull requests to be accepted, the bottom of your commit message must have
18
+ the following line using your name and e-mail address as it appears in the
19
+ OCA Signatories list.
20
+
21
+ ```
22
+ Signed-off-by: Your Name <you@example.org>
23
+ ```
24
+
25
+ This can be automatically added to pull requests by committing with:
26
+
27
+ ```
28
+ git commit --signoff
29
+ ```
30
+
31
+ Only pull requests from committers that can be verified as having
32
+ signed the OCA can be accepted.
33
+
34
+ ### Pull request process
35
+
36
+ 1. Fork this repository
37
+ 1. Create a branch in your fork to implement the changes. We recommend using
38
+ the issue number as part of your branch name, e.g. `1234-fixes`
39
+ 1. Ensure that any documentation is updated with the changes that are required
40
+ by your fix.
41
+ 1. Ensure that any samples are updated if the base image has been changed.
42
+ 1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly
43
+ what your changes are meant to do and provide simple steps on how to validate
44
+ your changes. Ensure that you reference the issue you created as well.
45
+ We will assign the pull request to 2-3 people for review before it is merged.
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,102 @@
1
+ capistrano-scm-makecopy
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
+ This is a fork from [capistrano-scm-copy](https://github.com/wercker/capistrano-scm-copy). It only fixed an issue that the tar command ran twice. As the repository was archived, I had to start all over again.
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-makecopy by adding it to your `Gemfile`:
27
+
28
+ gem "capistrano-scm-makecopy"
29
+
30
+ Add to Capfile:
31
+
32
+ require 'capistrano/makecopy'
33
+ install_plugin Capistrano::SCM::MakeCopy
34
+
35
+ TODO
36
+ ====
37
+
38
+ I'm new to programming for Capistrano and even Ruby in general. So any feedback is appreciated.
39
+
40
+ License
41
+ =======
42
+
43
+ The MIT License (MIT)
44
+
45
+ Changelog
46
+ =========
47
+
48
+ 0.8.4
49
+ -----
50
+
51
+ - Fix empty variable error
52
+
53
+ 0.8.3
54
+ -----
55
+
56
+ - Fix require error
57
+
58
+ 0.8.2
59
+ -----
60
+
61
+ - Update readme
62
+
63
+ 0.8.1
64
+ -----
65
+
66
+ - Fix issue [Appears to try to upload archive file 2x](https://github.com/wercker/capistrano-scm-copy/issues/17)
67
+
68
+ 0.5.0
69
+ -----
70
+
71
+ - Fix issue related to `tar_roles` (see wercker/capistrano-scm-copy#15)
72
+
73
+ 0.4.0
74
+ -----
75
+
76
+ - Add support for `tar_roles` (see wercker/capistrano-scm-copy#8)
77
+
78
+ 0.3.0
79
+ -----
80
+
81
+ - Fix issue when running on Mac OS X (see wercker/capistrano-scm-copy#9)
82
+ - Allow exclude directory to be an Array (see wercker/capistrano-scm-copy#9)
83
+
84
+ 0.2.0
85
+ -----
86
+
87
+ - Add `exclude_dir`
88
+
89
+ 0.1.0
90
+ -----
91
+
92
+ - Add `:include_dir`
93
+
94
+ 0.0.2
95
+ -----
96
+
97
+ - Add `task :set_current_revision`
98
+
99
+ 0.0.1
100
+ -----
101
+
102
+ - 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-makecopy"
6
+ s.version = "0.8.4"
7
+ s.licenses = ["MIT"]
8
+ s.authors = ["Morphling"]
9
+ s.email = ["283893159@qq.com"]
10
+ s.homepage = "https://github.com/Tindtily/capistrano-scm-makecopy"
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.0"
21
+ end
@@ -0,0 +1,11 @@
1
+ require "capistrano/scm/plugin"
2
+
3
+ class Capistrano::SCM::MakeCopy < Capistrano::SCM::Plugin
4
+ def define_tasks
5
+ eval_rakefile File.expand_path("../tasks/copy.rake", __FILE__)
6
+ end
7
+ def register_hooks
8
+ after "deploy:new_release_path", "copy:create_release"
9
+ after 'deploy:finished', 'copy:clean'
10
+ end
11
+ end
@@ -0,0 +1,47 @@
1
+ namespace :copy do
2
+
3
+ archive_name = "archive.tar.gz"
4
+
5
+ desc "Archive files to #{archive_name}"
6
+ file archive_name do
7
+ include_dir = fetch(:include_dir) || "*"
8
+ exclude_dir = Array(fetch(:exclude_dir))
9
+ exclude_args = exclude_dir.map { |dir| "--exclude '#{dir}'"}
10
+ tar_verbose = fetch(:tar_verbose, true) ? "v" : ""
11
+
12
+ file archive_name => FileList[include_dir].exclude(archive_name) do |t|
13
+ cmd = ["tar -c#{tar_verbose}zf #{t.name}", *exclude_args, *t.prerequisites]
14
+ sh cmd.join(' ')
15
+ end
16
+ end
17
+
18
+ desc "Deploy #{archive_name} to release_path"
19
+ task :deploy => archive_name do |t|
20
+ tarball = t.prerequisites.first
21
+
22
+ # Defalut to :all roles
23
+ tar_roles = fetch(:tar_roles, :all)
24
+
25
+ on roles(tar_roles) do
26
+ # Make sure the release directory exists
27
+ puts "==> release_path: #{release_path} is created on #{tar_roles} roles <=="
28
+ execute :mkdir, "-p", release_path
29
+
30
+ # Create a temporary file on the server
31
+ tmp_file = capture("mktemp")
32
+
33
+ # Upload the archive, extract it and finally remove the tmp_file
34
+ upload!(tarball, tmp_file)
35
+ execute :tar, "-xzf", tmp_file, "-C", release_path
36
+ execute :rm, tmp_file
37
+ end
38
+ end
39
+
40
+ task :clean do |t|
41
+ # Delete the local archive
42
+ File.delete archive_name if File.exists? archive_name
43
+ end
44
+
45
+
46
+ task :create_release => :deploy
47
+ 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,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-scm-makecopy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.4
5
+ platform: ruby
6
+ authors:
7
+ - Morphling
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-10-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
+ description: Copy strategy for capistrano 3.x
28
+ email:
29
+ - 283893159@qq.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - CONTRIBUTING.md
36
+ - Gemfile
37
+ - LICENSE
38
+ - README.md
39
+ - Rakefile
40
+ - capistrano-scm-makecopy.gemspec
41
+ - lib/capistrano-scm-copy.rb
42
+ - lib/capistrano/makecopy.rb
43
+ - lib/capistrano/tasks/copy.rake
44
+ - wercker.yml
45
+ homepage: https://github.com/Tindtily/capistrano-scm-makecopy
46
+ licenses:
47
+ - MIT
48
+ metadata: {}
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubygems_version: 3.0.3
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: Copy strategy for capistrano 3.x
68
+ test_files: []