wp-capistrano3 0.0.13 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano/tasks/install_plugins.rake +27 -13
- data/lib/capistrano/wp-capistrano/defaults.rb +2 -2
- data/wp-capistrano.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cab8932366840e65dfa57fe63d96833a43291f60ce7cf05e06157a458b62035a
|
4
|
+
data.tar.gz: 2e8872fc8a9543cb74d41d53b391c8c5298ae6d3c728b26f72dd81393ba46692
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8a6d8496fb735009e8e5afa95a62cf122fdacf5d2754df79dc1b8fdb277281ab524f504030b6f988ff912a442ac5c8a6bbb033a99de25d9bc2c6388330e3db7
|
7
|
+
data.tar.gz: f5b1ddbca6ab3e172b1909a049e49cd07aaf0efedef4f3933eb9754ce056fbb00e89313e9f8915dfef25aaaf3ce5a339fe4855a80ff3b24b771bf491b5bf86c6
|
@@ -3,13 +3,14 @@ namespace "wp-capistrano" do
|
|
3
3
|
desc 'Install wordpress plugins'
|
4
4
|
task :install_plugins do
|
5
5
|
on roles(:app) do
|
6
|
+
jsonPlugins = []
|
6
7
|
info "Check file #{release_path}/plugins.json"
|
7
8
|
if (test("[ -f #{release_path}/plugins.json ]"))
|
8
9
|
debug "#{release_path}/plugins.json exist"
|
9
10
|
pluginsStr = capture("cat #{release_path}/plugins.json")
|
10
11
|
jsonPlugins = JSON.parse(pluginsStr)
|
11
12
|
end
|
12
|
-
|
13
|
+
|
13
14
|
if(test("[ -L #{current_path} ]"))
|
14
15
|
info "installing pluggins..."
|
15
16
|
installedPlugins = capture("/usr/bin/env php /tmp/wp-cli.phar plugin list --path=#{current_path} |awk '{ print $1 }'")
|
@@ -19,7 +20,8 @@ namespace "wp-capistrano" do
|
|
19
20
|
installedPluginsVersion = capture("/usr/bin/env php /tmp/wp-cli.phar plugin list --path=#{current_path} |awk '{ print $4 }'")
|
20
21
|
installedPluginsVersionArr = installedPluginsVersion.to_s.gsub(/\n/, '|').split("|")
|
21
22
|
|
22
|
-
plugins = []
|
23
|
+
plugins = []
|
24
|
+
languages = []
|
23
25
|
|
24
26
|
installedPluginsArr.each_with_index do |plugin, index|
|
25
27
|
if(index == 0)
|
@@ -28,17 +30,26 @@ namespace "wp-capistrano" do
|
|
28
30
|
pluginInfo = {:slug => plugin, :version => installedPluginsVersionArr[index], :status => installedPluginsStatusArr[index] }
|
29
31
|
plugins.push(pluginInfo)
|
30
32
|
end
|
33
|
+
if( !jsonPlugins["plugins"].nil? )
|
34
|
+
jsonPlugins["plugins"].each do |plugin, version|
|
35
|
+
plugginInfo = plugins.detect {|f| f["slug"] == plugin }
|
36
|
+
if(plugginInfo)
|
37
|
+
plugginInfo[:version] = version
|
38
|
+
plugginInfo[:status] = "active"
|
39
|
+
else
|
40
|
+
pluginInfo = {:slug => plugin, :version => version, :status => "active" }
|
41
|
+
plugins.push(pluginInfo)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
if( !jsonPlugins["languages"].nil? )
|
47
|
+
jsonPlugins["languages"].each do |language|
|
48
|
+
execute "/usr/bin/env php /tmp/wp-cli.phar language core install #{language} --path=#{release_path}"
|
49
|
+
execute "/usr/bin/env php /tmp/wp-cli.phar language core activate #{language} --path=#{release_path}"
|
50
|
+
end
|
51
|
+
end
|
31
52
|
|
32
|
-
jsonPlugins.each do |plugin, version|
|
33
|
-
plugginInfo = plugins.detect {|f| f["slug"] == plugin }
|
34
|
-
if(plugginInfo)
|
35
|
-
plugginInfo[:version] = version
|
36
|
-
plugginInfo[:status] = "active"
|
37
|
-
else
|
38
|
-
pluginInfo = {:slug => plugin, :version => version, :status => "active" }
|
39
|
-
plugins.push(pluginInfo)
|
40
|
-
end
|
41
|
-
end
|
42
53
|
|
43
54
|
plugins.each do |plugin|
|
44
55
|
existingPlugins = capture("/usr/bin/env php /tmp/wp-cli.phar plugin search #{plugin[:slug]} --path=#{release_path} --field=slug --per-page=999999")
|
@@ -55,13 +66,16 @@ namespace "wp-capistrano" do
|
|
55
66
|
info "install #{plugin[:slug]}:#{plugin[:version]}"
|
56
67
|
if(plugin[:version]) == "latest"
|
57
68
|
execute "/usr/bin/env php /tmp/wp-cli.phar plugin install #{plugin[:slug]} --path=#{release_path}"
|
69
|
+
info "install #{plugin[:slug]}"
|
58
70
|
else
|
59
71
|
execute "/usr/bin/env php /tmp/wp-cli.phar plugin install #{plugin[:slug]} --path=#{release_path} --version=#{plugin[:version]}"
|
72
|
+
info "install #{plugin[:slug]} #{plugin[:version]}"
|
73
|
+
end
|
60
74
|
end
|
61
75
|
plugins.each do |plugin|
|
62
76
|
if (plugin[:status] == "active")
|
63
77
|
execute "/usr/bin/env php /tmp/wp-cli.phar plugin activate #{plugin[:slug]} --path=#{release_path}"
|
64
|
-
info "activate #{plugin}"
|
78
|
+
info "activate #{plugin[:slug]}"
|
65
79
|
else
|
66
80
|
execute "/usr/bin/env php /tmp/wp-cli.phar plugin deactivate #{plugin[:slug]} --path=#{release_path}"
|
67
81
|
info "deactivate #{plugin[:slug]}"
|
@@ -2,5 +2,5 @@
|
|
2
2
|
before 'deploy:check:linked_files', 'wp-capistrano:create_wp_config'
|
3
3
|
before 'deploy:updating', 'wp-capistrano:download_wordpress'
|
4
4
|
after 'wp-capistrano:download_wordpress', 'wp-capistrano:install_wordpress'
|
5
|
-
after 'wp-capistrano:
|
6
|
-
after 'deploy:updating', 'wp-capistrano:install_plugins'
|
5
|
+
after 'wp-capistrano:install_plugins', 'wp-capistrano:update_wordpress'
|
6
|
+
after 'deploy:updating', 'wp-capistrano:install_plugins'
|
data/wp-capistrano.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'wp-capistrano3'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.17'
|
8
8
|
spec.authors = ['Nicolas RENAULT']
|
9
9
|
spec.email = ['nrenault@tangkoko.com']
|
10
10
|
spec.description = %q{Wordpress tasks for Capistrano 3.x}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wp-capistrano3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas RENAULT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|