rails_deploy 0.1.1 → 0.2.0
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/LICENSE +20 -0
- data/lib/deploy.rb +12 -18
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ea33c4e2da1992be7c82c780b56bc2774f6a923aef97bbae6748ea549b60700
|
4
|
+
data.tar.gz: 667ff77b733b658ad495963b93e73710dddfa7fb83f472fcdc42075ba74b3911
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 347180f638f20967723869f4c74cd29db1f96b3f8ea7d60d4276f58ff00bec154863761a10879e7310bbc4ec056de7883ffd5db6ae6ec1b0591754f49b005cd7
|
7
|
+
data.tar.gz: 7d133329ef6a1174baaf6be4ae8f59725cddc41f84001afebec26c2b7800131a1be258be7d750a59d045a98d0c36cb8b2eefeac5731c4a396176de8b535c143e
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2023-Present Mingyuan Qin <mingyuan0715@foxmail.com>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/deploy.rb
CHANGED
@@ -8,21 +8,21 @@ require 'logger'
|
|
8
8
|
module Deploy
|
9
9
|
MOVED_DIRS = [
|
10
10
|
'log',
|
11
|
-
'tmp'
|
12
|
-
]
|
11
|
+
'tmp'
|
12
|
+
].freeze
|
13
13
|
SHARED_DIRS = [
|
14
14
|
'public/assets',
|
15
15
|
'public/fonts',
|
16
16
|
'vendor/bundle'
|
17
17
|
].freeze
|
18
|
-
SHARED_FILES = [
|
19
|
-
'config/credentials/production.key'
|
20
|
-
].freeze
|
21
18
|
INIT_DIRS = [
|
22
19
|
'tmp/sockets',
|
23
20
|
'tmp/pids',
|
24
21
|
'config/credentials'
|
25
22
|
].freeze
|
23
|
+
SHARED_FILES = [
|
24
|
+
'config/credentials/production.key'
|
25
|
+
].freeze
|
26
26
|
extend self
|
27
27
|
|
28
28
|
def restart
|
@@ -33,19 +33,13 @@ module Deploy
|
|
33
33
|
OpenSSL::HMAC.hexdigest('sha1', RailsCom.config.github_hmac_key, data)
|
34
34
|
end
|
35
35
|
|
36
|
-
def
|
37
|
-
dirs =
|
38
|
-
|
39
|
-
dirs += SHARED_DIRS.map { |dir| root.join(dir) }
|
40
|
-
dirs += INIT_DIRS.map { |dir| root.join(dir) }
|
41
|
-
FileUtils.mkdir_p dirs
|
36
|
+
def init(root: Pathname.pwd, shared: Pathname.pwd.join('../shared'))
|
37
|
+
dirs = (MOVED_DIRS + SHARED_DIRS + INIT_DIRS).map { |dir| shared.join(dir) }
|
38
|
+
FileUtils.mkdir_p dirs, verbose: true
|
42
39
|
|
43
|
-
SHARED_FILES.map
|
44
|
-
|
45
|
-
end
|
46
|
-
end
|
40
|
+
files = SHARED_FILES.map { |file| shared.join(file) }
|
41
|
+
FileUtils.touch files, verbose: true
|
47
42
|
|
48
|
-
def ln_shared_paths(root = Pathname.pwd)
|
49
43
|
cmds = []
|
50
44
|
cmds << 'bundle config set --local deployment true'
|
51
45
|
cmds << 'bundle config set --local path vendor/bundle'
|
@@ -54,10 +48,10 @@ module Deploy
|
|
54
48
|
"rm -rf #{root.join(path)}"
|
55
49
|
end
|
56
50
|
cmds += (MOVED_DIRS + SHARED_DIRS).map do |path|
|
57
|
-
"ln -Tsfv #{
|
51
|
+
"ln -Tsfv #{shared.join(path)} #{root.join(path)}"
|
58
52
|
end
|
59
53
|
cmds += SHARED_FILES.map do |path|
|
60
|
-
"ln -Tsfv #{
|
54
|
+
"ln -Tsfv #{shared.join(path)} #{root.join(path)}"
|
61
55
|
end
|
62
56
|
cmds.each do |cmd|
|
63
57
|
exec_cmd(cmd)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Mingyuan Qin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -45,6 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- LICENSE
|
48
49
|
- README.md
|
49
50
|
- lib/deploy.rb
|
50
51
|
homepage: https://github.com/work-design/rails_deploy
|
@@ -66,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
67
|
- !ruby/object:Gem::Version
|
67
68
|
version: '0'
|
68
69
|
requirements: []
|
69
|
-
rubygems_version: 3.
|
70
|
+
rubygems_version: 3.5.0.dev
|
70
71
|
signing_key:
|
71
72
|
specification_version: 4
|
72
73
|
summary: Deploy from server
|