wp-capistrano3 0.0.14 → 0.0.18

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: 8b631eb8e04c29b7409505e0881b840d75ea34721f7328ace0c75a18dc41f774
4
- data.tar.gz: 5587230658d518893f9fcb9ab744a3d4b4585e384db2e28331083213cdd2fdbe
3
+ metadata.gz: 63fc5b6cc98b49c6cd3ebd2a553f7610bda361c15cf6dcacedf197ee3ff157da
4
+ data.tar.gz: 87703e68b8a464877a86cf3a54c9e0395e47dfcb3bbfc6063080638578acf32d
5
5
  SHA512:
6
- metadata.gz: 81ac9b8e2f3b18fd278c1df5e8f002b8b50bd9dc1b75f2805145617e836f893ab6b5073e65e8701af28b52f748bf591eaaae824a798ed71af322be698a44cb99
7
- data.tar.gz: 006d0945de2329af572cc6e9b6d974dcd845b733f1fb903157f6eb10bb27ced0bbcbc5a55cc48ed921dad5039e935e3fdb3b8f89c9afea3f7f37954ff5559c88
6
+ metadata.gz: c5c67865a7100aec018648dc779baa86e29f8cb166bb0d4faf4c6010782de6a54838218cfcb387357ad82ce0485b066c1b0971efc5880fd98ee65c8af6649130
7
+ data.tar.gz: 24cec847d27ac8fac883ff05beb01af24e5d6f2a077661d72933307a0f26fc3d0db7f52b59a7ffe43cfd55506e190b7cadf61f01338cbfdb691993632d9dacac
@@ -2,10 +2,10 @@ namespace "wp-capistrano" do
2
2
  desc 'Download wordpress'
3
3
  task :download_wordpress do
4
4
  on roles(:app) do
5
- execute "wget -N http://wordpress.org/latest.tar.gz -P /tmp/"
5
+ execute "wget -N http://wordpress.org/latest.tar.gz -P #{fetch(:tmp_dir)}"
6
6
  execute "tar xzf /tmp/latest.tar.gz -C #{release_path} wordpress --strip-components=1"
7
- execute "wget -N https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -P /tmp/"
8
- execute "chmod u+x /tmp/wp-cli.phar"
7
+ execute "wget -N https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -P #{fetch(:tmp_dir)}"
8
+ execute "chmod u+x #{fetch(:tmp_dir)}"
9
9
  end
10
10
  end
11
11
  end
@@ -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,14 +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]}"
60
73
  end
61
74
  end
62
75
  plugins.each do |plugin|
63
76
  if (plugin[:status] == "active")
64
77
  execute "/usr/bin/env php /tmp/wp-cli.phar plugin activate #{plugin[:slug]} --path=#{release_path}"
65
- info "activate #{plugin}"
78
+ info "activate #{plugin[:slug]}"
66
79
  else
67
80
  execute "/usr/bin/env php /tmp/wp-cli.phar plugin deactivate #{plugin[:slug]} --path=#{release_path}"
68
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.14'
7
+ spec.version = '0.0.18'
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.14
4
+ version: 0.0.18
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-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano