capistrano-net_storage 0.2.0 → 0.2.1
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +10 -7
- data/lib/capistrano/net_storage/archiver/tar_gzip.rb +2 -2
- data/lib/capistrano/net_storage/archiver/zip.rb +2 -2
- data/lib/capistrano/net_storage/bundler.rb +2 -2
- data/lib/capistrano/net_storage/cleaner.rb +1 -1
- data/lib/capistrano/net_storage/scm/git.rb +5 -5
- data/lib/capistrano/net_storage/utils.rb +1 -1
- data/lib/capistrano/net_storage/version.rb +1 -1
- data/lib/capistrano/tasks/net_storage.rake +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35f517a8f2ab7cee137f213f5d5877232ba6af5c
|
4
|
+
data.tar.gz: 91078627bad46801f58f3dc5b0071c65cb45f836
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85eba6d6781acbcafd6783f1ce0ee8c5c3d497b8483e9791b99b213397ec657219dc29d394ec415830377128613d691fb72eac1c150267706e3b62785d766a6d
|
7
|
+
data.tar.gz: 8a0b154bff60805eb4981aad7db737b806d2a9985316f153a2d5d2b2ba57e04594b4495edb7fb95990c6759c586f89ae5ce66837c872963b2e38361c4d725b03
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://badge.fury.io/rb/capistrano-net_storage)
|
2
|
+
[](https://travis-ci.org/DeNADev/capistrano-net_storage)
|
1
3
|
# Capistrano::NetStorage
|
2
4
|
|
3
5
|
**Capistrano::NetStorage** is a [Capistrano](http://capistranorb.com/) plugin to deploy application
|
@@ -22,11 +24,6 @@ This library goes following procedures as _capistrano tasks_:
|
|
22
24
|
3. Download the archive from _remote storage_ on application servers.
|
23
25
|
* This task is executed in parallel way.
|
24
26
|
|
25
|
-
NOTE:
|
26
|
-
|
27
|
-
* You need to prepare a _transport class_ to execute upload/download operation suitable for
|
28
|
-
_remote storage_. It should inherit `Capistrano::NetStorage::Transport::Base` class.
|
29
|
-
|
30
27
|
## Installation
|
31
28
|
|
32
29
|
Add this line to your application's Gemfile:
|
@@ -66,7 +63,10 @@ Set Capistrano variables by `set name, value`.
|
|
66
63
|
|
67
64
|
Here are available plugins list which serves as `:net_storage_transport`:
|
68
65
|
|
69
|
-
- [Capistrano::NetStorage::S3::Transport](https://github.com/DeNADev/capistrano-net_storage-s3)
|
66
|
+
- [Capistrano::NetStorage::S3::Transport](https://github.com/DeNADev/capistrano-net_storage-s3) for [Amazon S3](https://aws.amazon.com/s3/)
|
67
|
+
|
68
|
+
If you wish a plugin for other types of _remote storage_, you can develop it. It should inherit
|
69
|
+
`Capistrano::NetStorage::Transport::Base` class.
|
70
70
|
|
71
71
|
## Usage
|
72
72
|
|
@@ -81,7 +81,7 @@ require 'capistrano/deploy'
|
|
81
81
|
|
82
82
|
# Includes tasks from other gems included in your Gemfile
|
83
83
|
require 'capistrano/net_storage'
|
84
|
-
# Load transport plugin
|
84
|
+
# Load transport plugin for Capistrano::NetStorage
|
85
85
|
# require 'capistrano/net_storage/s3'
|
86
86
|
```
|
87
87
|
|
@@ -113,3 +113,6 @@ Available as open source under the terms of the [MIT License](http://opensource.
|
|
113
113
|
|
114
114
|
Copyright (c) 2017 DeNA Co., Ltd., IKEDA Kiyoshi
|
115
115
|
|
116
|
+
## Special Thanks
|
117
|
+
|
118
|
+
The previous version of this program was originally developed by @bobpp.
|
@@ -6,14 +6,14 @@ class Capistrano::NetStorage::Archiver::TarGzip < Capistrano::NetStorage::Archiv
|
|
6
6
|
include Capistrano::NetStorage::Utils
|
7
7
|
|
8
8
|
def check
|
9
|
-
|
9
|
+
run_locally do
|
10
10
|
execute :which, 'tar'
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
def archive
|
15
15
|
c = config
|
16
|
-
|
16
|
+
run_locally do
|
17
17
|
within c.local_release_path do
|
18
18
|
execute :tar, 'czf', c.local_archive_path, '.'
|
19
19
|
end
|
@@ -6,14 +6,14 @@ class Capistrano::NetStorage::Archiver::Zip < Capistrano::NetStorage::Archiver::
|
|
6
6
|
include Capistrano::NetStorage::Utils
|
7
7
|
|
8
8
|
def check
|
9
|
-
|
9
|
+
run_locally do
|
10
10
|
execute :which, 'zip'
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
def archive
|
15
15
|
c = config
|
16
|
-
|
16
|
+
run_locally do
|
17
17
|
within c.local_release_path do
|
18
18
|
execute :zip, c.local_archive_path, '-r', '.'
|
19
19
|
end
|
@@ -7,7 +7,7 @@ module Capistrano
|
|
7
7
|
include Capistrano::NetStorage::Utils
|
8
8
|
|
9
9
|
def check
|
10
|
-
|
10
|
+
run_locally do
|
11
11
|
execute :which, 'bundle'
|
12
12
|
end
|
13
13
|
end
|
@@ -15,7 +15,7 @@ module Capistrano
|
|
15
15
|
# Do bundle install locally. Installed gems are to be included to the release.
|
16
16
|
def install
|
17
17
|
c = config
|
18
|
-
|
18
|
+
run_locally do
|
19
19
|
local_release_bundle_path = c.local_release_path.join('vendor', 'bundle')
|
20
20
|
execute :mkdir, '-p', local_release_bundle_path
|
21
21
|
execute :mkdir, '-p', "#{c.local_release_path}/.bundle"
|
@@ -11,7 +11,7 @@ module Capistrano
|
|
11
11
|
# @see Capistrano::NetStorage::Config#local_releases_path
|
12
12
|
def cleanup_local_release
|
13
13
|
c = config
|
14
|
-
|
14
|
+
run_locally do
|
15
15
|
releases = capture(:ls, '-xtr', c.local_releases_path).split
|
16
16
|
# Contains archive files and extracted directories
|
17
17
|
if releases.count > fetch(:keep_releases) * 2
|
@@ -3,14 +3,14 @@ require 'capistrano/net_storage/scm/base'
|
|
3
3
|
# Internal SCM class for Git repository
|
4
4
|
class Capistrano::NetStorage::SCM::Git < Capistrano::NetStorage::SCM::Base
|
5
5
|
def check
|
6
|
-
|
6
|
+
run_locally do
|
7
7
|
execute :git, 'ls-remote', repo_url, 'HEAD'
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
11
|
def clone
|
12
12
|
c = config
|
13
|
-
|
13
|
+
run_locally do
|
14
14
|
if File.exist?("#{c.local_mirror_path}/HEAD")
|
15
15
|
info t(:mirror_exists, at: c.local_mirror_path)
|
16
16
|
else
|
@@ -21,7 +21,7 @@ class Capistrano::NetStorage::SCM::Git < Capistrano::NetStorage::SCM::Base
|
|
21
21
|
|
22
22
|
def update
|
23
23
|
c = config
|
24
|
-
|
24
|
+
run_locally do
|
25
25
|
within c.local_mirror_path do
|
26
26
|
execute :git, :remote, :update
|
27
27
|
end
|
@@ -31,7 +31,7 @@ class Capistrano::NetStorage::SCM::Git < Capistrano::NetStorage::SCM::Base
|
|
31
31
|
def set_current_revision
|
32
32
|
return if fetch(:current_revision)
|
33
33
|
c = config
|
34
|
-
|
34
|
+
run_locally do
|
35
35
|
within c.local_mirror_path do
|
36
36
|
set :current_revision, capture(:git, "rev-parse #{fetch(:branch)}")
|
37
37
|
end
|
@@ -40,7 +40,7 @@ class Capistrano::NetStorage::SCM::Git < Capistrano::NetStorage::SCM::Base
|
|
40
40
|
|
41
41
|
def prepare_archive
|
42
42
|
c = config
|
43
|
-
|
43
|
+
run_locally do
|
44
44
|
execute :mkdir, '-p', c.local_release_path
|
45
45
|
|
46
46
|
within c.local_mirror_path do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-net_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- progrhyme
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|