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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 805d93c6aca4e56472b1a31ebef1626a28753f47f754c0ee0663f32c9c9f1502
4
- data.tar.gz: 6767462809c7f5e3704a2404e7f8a18b203817046f4528c54af534bab88d14ee
3
+ metadata.gz: cab8932366840e65dfa57fe63d96833a43291f60ce7cf05e06157a458b62035a
4
+ data.tar.gz: 2e8872fc8a9543cb74d41d53b391c8c5298ae6d3c728b26f72dd81393ba46692
5
5
  SHA512:
6
- metadata.gz: aa8455490fa210afa2985b5367dbe57e097fab269db55433feb1d6cb59e3d17aaec675cfbddc7fc609b969d55f01ac120156d17f37b3e23eec7ade0dbda8d6aa
7
- data.tar.gz: 5c49735bd89f92558204bdb40c8890fbdbfe41eed69f251fd8eecb7f106ec7348a23b03c18efb0873a547ac39f9afac9dc667b2de8ddaba29a6ac96410cba2bf
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:install_wordpress', 'wp-capistrano:update_wordpress'
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'
@@ -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.13'
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.13
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-05-11 00:00:00.000000000 Z
11
+ date: 2021-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano