wp-capistrano3 0.0.6 → 0.0.7
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/README.md +18 -0
- data/lib/capistrano/tasks/install_plugins.rake +14 -6
- data/lib/capistrano/wp-capistrano.rb +0 -1
- data/lib/capistrano/wp-capistrano/defaults.rb +1 -2
- data/wp-capistrano.gemspec +1 -1
- metadata +3 -5
- data/lib/capistrano/Rakefile +0 -1
- data/lib/capistrano/tasks/deploy-theme.rake +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1e6df5f94f90b486745d8351692c078263b21e7a3e9338ac2409b60e3633760
|
4
|
+
data.tar.gz: 2458831aff2c7ae5a1e7b6d3d02b82280d3866f38ebd6d45ee7e4f1f29d1aa65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd9508e405ec8a73d99d852939619034a7216e3a6b7d966814a54556301b075cca7fd7a4276b96a83e47e6b470e75590921073dfa5246dd7dd80fbf12a49fe2c
|
7
|
+
data.tar.gz: f17e06bbeb8cbdeedf73c1e528c1c837e439abc68190e9d051476bb6501311b73776e7f1856b7195260fa0e8554d47c9f89f1f1ee217d72aa6b8744e2ffe49bc
|
data/README.md
CHANGED
@@ -18,6 +18,23 @@ Then run
|
|
18
18
|
bundle install
|
19
19
|
#or bundle update
|
20
20
|
```
|
21
|
+
set following variables in your deploy.rb
|
22
|
+
These variables will be used to generate wp_config.php at first deployment.
|
23
|
+
And will install an empty wordpress
|
24
|
+
```ruby
|
25
|
+
set :wp_db_name, "wp_db_name"
|
26
|
+
set :wp_db_password, "wp_db_password"
|
27
|
+
set :wp_db_user, "wp_db_user"
|
28
|
+
set :wp_db_host, "127.0.0.1"
|
29
|
+
#ADMIN LOCALE
|
30
|
+
set :wp_locale, "en_GB"
|
31
|
+
|
32
|
+
set :wp_url, "wp_domain"
|
33
|
+
set :wp_title, "wp site name"
|
34
|
+
set :wp_admin_user, "admin"
|
35
|
+
set :wp_admin_password, "password"
|
36
|
+
set :wp_admin_email, "admin@xxxx.com"
|
37
|
+
```
|
21
38
|
|
22
39
|
## Workflow
|
23
40
|
|
@@ -28,4 +45,5 @@ before 'deploy:check:linked_files', 'wp-capistrano:create_wp_config'
|
|
28
45
|
before 'deploy:updating', 'wp-capistrano:download_wordpress'
|
29
46
|
after 'wp-capistrano:download_wordpress', 'wp-capistrano:install_wordpress'
|
30
47
|
after 'wp-capistrano:download_wordpress', 'wp-capistrano:update_wordpress'
|
48
|
+
after 'wp-capistrano:install_wordpress', 'wp-capistrano:install_plugins'
|
31
49
|
```
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'json'
|
1
2
|
namespace "wp-capistrano" do
|
2
3
|
desc 'Install wordpress plugins'
|
3
4
|
task :install_plugins do
|
@@ -24,6 +25,9 @@ while [ "$1" != "" ]; do
|
|
24
25
|
-c | --current_path ) shift
|
25
26
|
current_path="$1"
|
26
27
|
;;
|
28
|
+
-p | --plugins ) shift
|
29
|
+
plugins="$1"
|
30
|
+
;;
|
27
31
|
-n | --new_path ) shift
|
28
32
|
new_path="$1"
|
29
33
|
;;
|
@@ -49,6 +53,8 @@ then
|
|
49
53
|
exit
|
50
54
|
fi
|
51
55
|
|
56
|
+
echo $plugins
|
57
|
+
|
52
58
|
echo -e "\e[32mInstalling plugins ...\e[0m"
|
53
59
|
|
54
60
|
plugins=($(/usr/local/bin/php /tmp/wp-cli.phar plugin list --path=$current_path |awk '{ print $1 }'))
|
@@ -57,19 +63,21 @@ plugins_status=($(/usr/local/bin/php /tmp/wp-cli.phar plugin list --path=$curren
|
|
57
63
|
plugins_versions=($(/usr/local/bin/php /tmp/wp-cli.phar plugin list --path=$current_path |awk '{ print $4 }'))
|
58
64
|
for i in `seq 1 $nbPlugins`;
|
59
65
|
do
|
60
|
-
/usr/local/bin/php /tmp/wp-cli.phar plugin install ${plugins[i]} --path=$new_path
|
66
|
+
/usr/local/bin/php /tmp/wp-cli.phar plugin install ${plugins[i]} --path=$new_path --version=${plugins_versions[i]}
|
61
67
|
echo /usr/local/bin/php /tmp/wp-cli.phar plugin install ${plugins[i]} --path=$new_path
|
62
68
|
if [ ${plugins_status[i]} = "active" ];
|
63
69
|
then
|
64
|
-
/usr/local/bin/php /tmp/wp-cli.phar plugin activate ${plugins[i]} --path=$new_path
|
70
|
+
/usr/local/bin/php /tmp/wp-cli.phar plugin activate ${plugins[i]} --path=$new_path
|
65
71
|
else
|
66
|
-
/usr/local/bin/php /tmp/wp-cli.phar plugin deactivate ${plugins[i]} --path=$new_path
|
72
|
+
/usr/local/bin/php /tmp/wp-cli.phar plugin deactivate ${plugins[i]} --path=$new_path
|
67
73
|
fi
|
68
74
|
done
|
69
75
|
BASH
|
70
|
-
|
71
76
|
upload! StringIO.new(bashScript), "/tmp/install_plugins.sh"
|
72
|
-
|
73
|
-
|
77
|
+
if(File.exist?("#{release_path}/plugins.json"))
|
78
|
+
then plugins = JSON.parse(File.read("#{release_path}/plugins.json"))
|
79
|
+
end
|
80
|
+
execute "/bin/bash /tmp/install_plugins.sh -c \"#{current_path}\" -n #{release_path} -p #{plugins}"
|
81
|
+
end
|
74
82
|
end
|
75
83
|
end
|
@@ -3,5 +3,4 @@ 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
5
|
after 'wp-capistrano:download_wordpress', 'wp-capistrano:install_wordpress'
|
6
|
-
after 'wp-capistrano:install_wordpress', 'wp-capistrano:install_plugins'
|
7
|
-
#before 'deploy:updated', 'wp-capistrano:deploy-theme'
|
6
|
+
after 'wp-capistrano:install_wordpress', '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.7'
|
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.7
|
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-03-
|
11
|
+
date: 2021-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -64,9 +64,7 @@ files:
|
|
64
64
|
- README.md
|
65
65
|
- Rakefile
|
66
66
|
- gemfile
|
67
|
-
- lib/capistrano/Rakefile
|
68
67
|
- lib/capistrano/tasks/create_wp_config.rake
|
69
|
-
- lib/capistrano/tasks/deploy-theme.rake
|
70
68
|
- lib/capistrano/tasks/download_wordpress.rake
|
71
69
|
- lib/capistrano/tasks/install_plugins.rake
|
72
70
|
- lib/capistrano/tasks/install_wordpress.rake
|
@@ -94,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
92
|
- !ruby/object:Gem::Version
|
95
93
|
version: '0'
|
96
94
|
requirements: []
|
97
|
-
rubygems_version: 3.
|
95
|
+
rubygems_version: 3.2.15
|
98
96
|
signing_key:
|
99
97
|
specification_version: 4
|
100
98
|
summary: Wordpress tasks for Capistrano 3.x
|
data/lib/capistrano/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
@@ -1,15 +0,0 @@
|
|
1
|
-
namespace "wp-capistrano" do
|
2
|
-
desc 'upload theme compiled files'
|
3
|
-
task :deploy-theme do
|
4
|
-
run_locally do
|
5
|
-
role_properties(:app) do |server|
|
6
|
-
ssh_options = server.ssh_options
|
7
|
-
fetch(:themes_to_deploy).each do |theme|
|
8
|
-
themesParentDir = theme.split("/")
|
9
|
-
themesParentDir.pop()
|
10
|
-
execute "scp -r -P #{server.ssh_options[:port]} #{ENV['SOURCE_PATH']}/#{theme} #{server.user}@#{server.hostname}:#{release_path}/#{themesParentDir.join("/")}"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|