theme-juice 0.16.7 → 0.17.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/lib/theme-juice/cli.rb +1 -0
- data/lib/theme-juice/commands/deploy.rb +3 -2
- data/lib/theme-juice/env.rb +1 -0
- data/lib/theme-juice/man/tj-deploy +7 -1
- data/lib/theme-juice/man/tj-deploy.txt +5 -1
- data/lib/theme-juice/tasks/capistrano/dir.rb +70 -7
- data/lib/theme-juice/tasks/capistrano/uploads.rb +12 -10
- data/lib/theme-juice/tasks/settings.rb +26 -25
- data/lib/theme-juice/version.rb +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: 39f80f4b6db54e005e45e62ccad706ac2e740761
|
4
|
+
data.tar.gz: 7f5136693cd24c83ab29c7d42010cf9285976976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 833ee941d9bccccfe98be2bcebf66635d778badc49b95f56e08ed9154bc8f67696a9408597ce39653730282bf91e8d120461e6f57fe3a611e2a5efa433a2aeea
|
7
|
+
data.tar.gz: 9223ad305b744e2579ed60f854e47fac7166ed5401e5e323150f564b7da6fecc863f9c4b7674fd2102af5ee899633f00d6fa475e66255c44315a61a2adbbb2e8
|
data/lib/theme-juice/cli.rb
CHANGED
@@ -135,6 +135,7 @@ module ThemeJuice
|
|
135
135
|
end
|
136
136
|
|
137
137
|
desc "deploy STAGE [,ARGS]", "Deploy a project"
|
138
|
+
method_option :archive, :type => :boolean, :aliases => %w[--tar --gzip --zip], :desc => ""
|
138
139
|
def deploy(stage, *args)
|
139
140
|
@deploy.new(options).send(stage, *args).execute
|
140
141
|
end
|
@@ -9,8 +9,9 @@ module ThemeJuice
|
|
9
9
|
|
10
10
|
@config.deployment.stages.keys.each do |stage|
|
11
11
|
self.class.send :define_method, stage do |*args|
|
12
|
-
@env.cap
|
13
|
-
@env.stage
|
12
|
+
@env.cap = Capistrano::Application.new
|
13
|
+
@env.stage = stage.to_sym
|
14
|
+
@env.archive = opts[:archive]
|
14
15
|
|
15
16
|
runner do |tasks|
|
16
17
|
tasks << Tasks::Settings.new
|
data/lib/theme-juice/env.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "TJ\-DEPLOY" "1" "
|
4
|
+
.TH "TJ\-DEPLOY" "1" "November 2015" "" "Theme Juice Manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBtj\-deploy\fR \- Deploy a project
|
@@ -35,6 +35,12 @@ Deploy!
|
|
35
35
|
.
|
36
36
|
.IP "" 0
|
37
37
|
.
|
38
|
+
.SH "GLOBAL OPTIONS"
|
39
|
+
.
|
40
|
+
.TP
|
41
|
+
\fB\-\-archive\fR, \fB\-\-tar\fR, \fB\-\-gzip\fR, \fB\-\-zip\fR
|
42
|
+
Archive directories when performing file transfers with tar(1)
|
43
|
+
.
|
38
44
|
.SH "PRIMARY COMMANDS"
|
39
45
|
If no command is passed, the default task to be executed is \fBdeploy\fR
|
40
46
|
.
|
@@ -31,6 +31,10 @@ SETUP
|
|
31
31
|
|
32
32
|
|
33
33
|
|
34
|
+
GLOBAL OPTIONS
|
35
|
+
--archive, --tar, --gzip, --zip
|
36
|
+
Archive directories when performing file transfers with tar(1)
|
37
|
+
|
34
38
|
PRIMARY COMMANDS
|
35
39
|
If no command is passed, the default task to be executed is deploy
|
36
40
|
|
@@ -177,4 +181,4 @@ CONFIG FILE
|
|
177
181
|
|
178
182
|
|
179
183
|
|
180
|
-
|
184
|
+
November 2015 TJ-DEPLOY(1)
|
@@ -1,24 +1,87 @@
|
|
1
1
|
namespace :dir do
|
2
2
|
|
3
|
+
desc "Initialize transfer variables"
|
4
|
+
task :init do
|
5
|
+
set :dir_archive, "archive.tar.gz"
|
6
|
+
|
7
|
+
run_locally do
|
8
|
+
execute :mkdir, "-p", fetch(:vm_tmp_dir)
|
9
|
+
end
|
10
|
+
|
11
|
+
on roles(:app) do
|
12
|
+
within release_path do
|
13
|
+
execute :mkdir, "-p", fetch(:tmp_dir)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
3
18
|
desc "Recursively push directory to remote"
|
4
19
|
task :push, [:dir] do |t, args|
|
20
|
+
invoke "dir:init"
|
21
|
+
|
22
|
+
error "Could not locate local directory '#{args[:dir]}'" unless File.exist? args[:dir]
|
23
|
+
|
5
24
|
on roles(:app) do
|
6
|
-
|
25
|
+
within release_path do
|
26
|
+
execute :mkdir, "-p", args[:dir]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
if fetch(:archive)
|
31
|
+
on roles(:dev) do
|
32
|
+
within fetch(:dev_path) do
|
33
|
+
execute :tar, "-zcf", "#{fetch(:vm_tmp_dir)}/#{fetch(:dir_archive)}", "#{args[:dir]}/*"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
on release_roles(:app) do
|
38
|
+
upload! "#{fetch(:vm_tmp_dir)}/#{fetch(:dir_archive)}", release_path
|
39
|
+
.join("#{fetch(:tmp_dir)}/#{fetch(:dir_archive)}")
|
40
|
+
|
41
|
+
within release_path do
|
42
|
+
execute :tar, "--no-overwrite-dir -zxf", "#{fetch(:tmp_dir)}/#{fetch(:dir_archive)}", "#{args[:dir]}/"
|
43
|
+
execute :rm,"#{fetch(:tmp_dir)}/#{fetch(:dir_archive)}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
else
|
47
|
+
on roles(:app) do
|
7
48
|
upload! args[:dir], release_path.join(Pathname.new(args[:dir]).parent), {
|
8
49
|
recursive: true
|
9
50
|
}
|
10
|
-
else
|
11
|
-
error "Could not locate local directory '#{args[:dir]}'"
|
12
51
|
end
|
13
52
|
end
|
14
53
|
end
|
15
54
|
|
16
55
|
desc "Recursively pull directory from remote"
|
17
56
|
task :pull, [:dir] do |t, args|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
57
|
+
invoke "dir:init"
|
58
|
+
|
59
|
+
run_locally do
|
60
|
+
execute :mkdir, "-p", args[:dir]
|
61
|
+
end
|
62
|
+
|
63
|
+
if fetch(:archive)
|
64
|
+
on release_roles(:app) do
|
65
|
+
within release_path do
|
66
|
+
execute :tar, "-hzcf", "#{fetch(:tmp_dir)}/#{fetch(:dir_archive)}", "#{args[:dir]}/*"
|
67
|
+
download! release_path.join("#{fetch(:tmp_dir)}/#{fetch(:dir_archive)}"),
|
68
|
+
"#{fetch(:vm_tmp_dir)}/#{fetch(:dir_archive)}"
|
69
|
+
execute :rm,"#{fetch(:tmp_dir)}/#{fetch(:dir_archive)}"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
on roles(:dev) do
|
74
|
+
within fetch(:dev_path) do
|
75
|
+
execute :tar, "--no-overwrite-dir -zxf", "#{fetch(:vm_tmp_dir)}/#{fetch(:dir_archive)}", "#{args[:dir]}/"
|
76
|
+
execute :rm,"#{fetch(:vm_tmp_dir)}/#{fetch(:dir_archive)}"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
else
|
80
|
+
on roles(:app) do
|
81
|
+
download! release_path.join(args[:dir]), Pathname.new(args[:dir]).parent, {
|
82
|
+
recursive: true
|
83
|
+
}
|
84
|
+
end
|
22
85
|
end
|
23
86
|
end
|
24
87
|
end
|
@@ -4,19 +4,21 @@ namespace :uploads do
|
|
4
4
|
|
5
5
|
desc "Push local uploads to remote"
|
6
6
|
task :push do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
invoke "dir:push", fetch(:uploads_dir)
|
8
|
+
# on roles(:app) do
|
9
|
+
# upload! fetch(:vm_uploads_dir), shared_path.join(Pathname.new(fetch(:uploads_dir)).parent), {
|
10
|
+
# recursive: true
|
11
|
+
# }
|
12
|
+
# end
|
12
13
|
end
|
13
14
|
|
14
15
|
desc "Pull remote uploads to local"
|
15
16
|
task :pull do
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
invoke "dir:pull", fetch(:uploads_dir)
|
18
|
+
# on roles(:app) do
|
19
|
+
# download! shared_path.join(fetch(:uploads_dir)), Pathname.new(fetch(:vm_uploads_dir)).parent, {
|
20
|
+
# recursive: true
|
21
|
+
# }
|
22
|
+
# end
|
21
23
|
end
|
22
24
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module ThemeJuice
|
4
|
-
module Tasks
|
5
|
-
class Settings < Task
|
6
|
-
include Capistrano::DSL
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
super
|
10
|
-
end
|
11
|
-
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module ThemeJuice
|
4
|
+
module Tasks
|
5
|
+
class Settings < Task
|
6
|
+
include Capistrano::DSL
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
super
|
10
|
+
end
|
11
|
+
|
12
12
|
def execute
|
13
13
|
@io.log "Configuring Capistrano"
|
14
14
|
|
@@ -18,19 +18,20 @@ module ThemeJuice
|
|
18
18
|
configure_required_settings
|
19
19
|
configure_optional_settings
|
20
20
|
end
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
# Required global settings
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
# Required global settings
|
26
26
|
def configure_required_settings
|
27
27
|
begin
|
28
28
|
set :application, @config.deployment.application.name
|
29
|
-
|
29
|
+
set :archive, @env.archive
|
30
|
+
|
30
31
|
set :linked_files, fetch(:linked_files, []).concat(fetch(:shared_files, []))
|
31
32
|
set :linked_dirs, fetch(:linked_dirs, []).concat(fetch(:shared_dirs, []))
|
32
33
|
.push(fetch(:uploads_dir, ""))
|
33
|
-
|
34
|
+
|
34
35
|
%w[settings repository].each do |task|
|
35
36
|
@config.deployment.send(task).symbolize_keys.each do |key, value|
|
36
37
|
set key, proc { value }
|
@@ -41,9 +42,9 @@ module ThemeJuice
|
|
41
42
|
puts err
|
42
43
|
end
|
43
44
|
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Optional namespaced settings
|
45
|
+
end
|
46
|
+
|
47
|
+
# Optional namespaced settings
|
47
48
|
def configure_optional_settings
|
48
49
|
%w[rsync slack].each do |task|
|
49
50
|
if @config.deployment.key? task
|
@@ -52,7 +53,7 @@ module ThemeJuice
|
|
52
53
|
end
|
53
54
|
end
|
54
55
|
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/theme-juice/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theme-juice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|