wp-capistrano3 0.0.15 → 0.0.19
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/download_wordpress.rake +3 -3
- data/lib/capistrano/tasks/install_plugins.rake +32 -20
- data/lib/capistrano/tasks/install_wordpress.rake +3 -3
- data/lib/capistrano/tasks/update_wordpress.rake +2 -2
- 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: a1c364df0978937553b23a597a5626ebf662376f4bef1591efd44f715cf766f7
|
4
|
+
data.tar.gz: 83a926ead25a4f391fa0e699d4b89a426cd5d2877fe59f1dbbfe20a8c91bd768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf00e3edb8f83dd49ec29749fb01fe3f537ec987b7f34af8f9c1474848e9acf0329add2c833c9127a11cd201e2bf27f1996746d21d71134cdc603b9f7d620e45
|
7
|
+
data.tar.gz: 80eec506317647bf39b6d1c9eb6881f82dd31d8fec26a59e15d4df32dab7fe81c1c8713b671d526b17c09732e24f96843aa34d05770ec5b0d2a394fd7b83dc18
|
@@ -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
|
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
|
8
|
-
execute "chmod u+x /
|
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)}/wp-cli.phar"
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -13,14 +13,15 @@ namespace "wp-capistrano" do
|
|
13
13
|
|
14
14
|
if(test("[ -L #{current_path} ]"))
|
15
15
|
info "installing pluggins..."
|
16
|
-
installedPlugins = capture("/usr/bin/env php /
|
16
|
+
installedPlugins = capture("/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin list --path=#{current_path} |awk '{ print $1 }'")
|
17
17
|
installedPluginsArr = installedPlugins.to_s.gsub(/\n/, '|').split("|")
|
18
|
-
installedPluginsStatus = capture("/usr/bin/env php /
|
18
|
+
installedPluginsStatus = capture("/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin list --path=#{current_path} |awk '{ print $2 }'")
|
19
19
|
installedPluginsStatusArr = installedPluginsStatus.to_s.gsub(/\n/, '|').split("|")
|
20
|
-
installedPluginsVersion = capture("/usr/bin/env php /
|
20
|
+
installedPluginsVersion = capture("/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin list --path=#{current_path} |awk '{ print $4 }'")
|
21
21
|
installedPluginsVersionArr = installedPluginsVersion.to_s.gsub(/\n/, '|').split("|")
|
22
22
|
|
23
|
-
plugins = []
|
23
|
+
plugins = []
|
24
|
+
languages = []
|
24
25
|
|
25
26
|
installedPluginsArr.each_with_index do |plugin, index|
|
26
27
|
if(index == 0)
|
@@ -29,20 +30,29 @@ namespace "wp-capistrano" do
|
|
29
30
|
pluginInfo = {:slug => plugin, :version => installedPluginsVersionArr[index], :status => installedPluginsStatusArr[index] }
|
30
31
|
plugins.push(pluginInfo)
|
31
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 #{fetch(:tmp_dir)}/wp-cli.phar language core install #{language} --path=#{release_path}"
|
49
|
+
execute "/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar language core activate #{language} --path=#{release_path}"
|
50
|
+
end
|
51
|
+
end
|
32
52
|
|
33
|
-
jsonPlugins.each do |plugin, version|
|
34
|
-
plugginInfo = plugins.detect {|f| f["slug"] == plugin }
|
35
|
-
if(plugginInfo)
|
36
|
-
plugginInfo[:version] = version
|
37
|
-
plugginInfo[:status] = "active"
|
38
|
-
else
|
39
|
-
pluginInfo = {:slug => plugin, :version => version, :status => "active" }
|
40
|
-
plugins.push(pluginInfo)
|
41
|
-
end
|
42
|
-
end
|
43
53
|
|
44
54
|
plugins.each do |plugin|
|
45
|
-
existingPlugins = capture("/usr/bin/env php /
|
55
|
+
existingPlugins = capture("/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin search #{plugin[:slug]} --path=#{release_path} --field=slug --per-page=999999")
|
46
56
|
if (existingPlugins.to_s.gsub(/\n/, '|').split("|").include?("#{plugin[:slug]}") == false)
|
47
57
|
warn "Pluggin #{plugin[:slug]} not known in wordpress repository. skip installation"
|
48
58
|
next
|
@@ -55,17 +65,19 @@ namespace "wp-capistrano" do
|
|
55
65
|
|
56
66
|
info "install #{plugin[:slug]}:#{plugin[:version]}"
|
57
67
|
if(plugin[:version]) == "latest"
|
58
|
-
execute "/usr/bin/env php /
|
68
|
+
execute "/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin install #{plugin[:slug]} --path=#{release_path}"
|
69
|
+
info "install #{plugin[:slug]}"
|
59
70
|
else
|
60
|
-
execute "/usr/bin/env php /
|
71
|
+
execute "/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin install #{plugin[:slug]} --path=#{release_path} --version=#{plugin[:version]}"
|
72
|
+
info "install #{plugin[:slug]} #{plugin[:version]}"
|
61
73
|
end
|
62
74
|
end
|
63
75
|
plugins.each do |plugin|
|
64
76
|
if (plugin[:status] == "active")
|
65
|
-
execute "/usr/bin/env php /
|
66
|
-
info "activate #{plugin}"
|
77
|
+
execute "/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin activate #{plugin[:slug]} --path=#{release_path}"
|
78
|
+
info "activate #{plugin[:slug]}"
|
67
79
|
else
|
68
|
-
execute "/usr/bin/env php /
|
80
|
+
execute "/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin deactivate #{plugin[:slug]} --path=#{release_path}"
|
69
81
|
info "deactivate #{plugin[:slug]}"
|
70
82
|
end
|
71
83
|
end
|
@@ -3,9 +3,9 @@ namespace "wp-capistrano" do
|
|
3
3
|
task :install_wordpress do
|
4
4
|
on roles(:app), filter: :no_release do
|
5
5
|
execute "rm #{shared_path}/wp-config.php"
|
6
|
-
execute "php /
|
6
|
+
execute "php #{fetch(:tmp_dir)}/wp-cli.phar config create --dbname=#{fetch(:wp_db_name)} --dbuser=#{fetch(:wp_db_user)} --dbpass=#{fetch(:wp_db_password)} --dbhost='#{fetch(:wp_db_host)}' --locale=#{fetch(:wp_locale)} --path=#{release_path}"
|
7
7
|
execute "cp #{release_path}/wp-config.php #{shared_path}/"
|
8
|
-
execute "php /
|
8
|
+
execute "php #{fetch(:tmp_dir)}/wp-cli.phar core install --url='#{fetch(:wp_url)}' --title='#{fetch(:wp_title)}' --admin_user='#{fetch(:wp_admin_user)}' --admin_password='#{fetch(:wp_admin_password)}' --admin_email='#{fetch(:wp_admin_email)}' --skip-email --path=#{release_path}"
|
9
9
|
end
|
10
10
|
end
|
11
|
-
end
|
11
|
+
end
|
@@ -2,7 +2,7 @@ namespace "wp-capistrano" do
|
|
2
2
|
desc 'Download wordpress'
|
3
3
|
task :update_wordpress do
|
4
4
|
on roles(:app) do
|
5
|
-
execute "php /
|
5
|
+
execute "php #{fetch(:tmp_dir)}/wp-cli.phar core update --path=#{release_path}"
|
6
6
|
end
|
7
7
|
end
|
8
|
-
end
|
8
|
+
end
|
@@ -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.19'
|
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.19
|
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-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|