wp-capistrano3 0.0.16 → 0.0.20

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: ff2c58a3b43c9cd1edeaab949816dfdf6013f3697db5a8a1d63d5ddbd0366efc
4
- data.tar.gz: a57872fe96afbd6aa45610a3a7aa76f2519fcb6394bc087ca0c6a2e7aaab9e46
3
+ metadata.gz: dd8315c1efb7c5b442112815ddae787294375296c38ac75e3f548248d147460f
4
+ data.tar.gz: 86149f83713ebfb908435cb7beee48b31ccb2742533561b4b9d5e34da9bf9c50
5
5
  SHA512:
6
- metadata.gz: e7ce10075342bc37df272280adaeea1461db31ec8674867796d9666e73c7a870fc17633d6f5e0d71a92d67579b237ec91c6e88a80aac042df3dafee5efc114ff
7
- data.tar.gz: cc7d54beeb8258d52b4ded60d45bbab569387635a9f1729aaeeac043448786747fd23913bc923bf0eb19bc5df5e4878fe9ac24e00362fb10e00c7b34449f0062
6
+ metadata.gz: e782951f9b83ebeb4d074bca03cd88cc50ecc340ef0b16d07071aadb9044016d25ed09532aade1fbb1c0f8d8cb64ef263162e7b87b8e55e2b776426303d3a7ff
7
+ data.tar.gz: 17ac5ba881c1b641d51fcd0a83b9bce2fafc5173380bc9706ad057fa5360ff84ff5c01abb7e885af084d1363f3bcb712eaf153d1308b369950e0891bfe828c8c
@@ -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)}/wp-cli.phar"
9
9
  end
10
10
  end
11
11
  end
@@ -13,11 +13,11 @@ 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 /tmp/wp-cli.phar plugin list --path=#{current_path} |awk '{ print $1 }'")
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 /tmp/wp-cli.phar plugin list --path=#{current_path} |awk '{ print $2 }'")
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 /tmp/wp-cli.phar plugin list --path=#{current_path} |awk '{ print $4 }'")
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
23
  plugins = []
@@ -31,7 +31,7 @@ namespace "wp-capistrano" do
31
31
  plugins.push(pluginInfo)
32
32
  end
33
33
  if( !jsonPlugins["plugins"].nil? )
34
- jsonPlugins.each do |plugin, version|
34
+ jsonPlugins["plugins"].each do |plugin, version|
35
35
  plugginInfo = plugins.detect {|f| f["slug"] == plugin }
36
36
  if(plugginInfo)
37
37
  plugginInfo[:version] = version
@@ -45,14 +45,14 @@ namespace "wp-capistrano" do
45
45
 
46
46
  if( !jsonPlugins["languages"].nil? )
47
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}"
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
50
  end
51
51
  end
52
52
 
53
53
 
54
54
  plugins.each do |plugin|
55
- existingPlugins = capture("/usr/bin/env php /tmp/wp-cli.phar plugin search #{plugin[:slug]} --path=#{release_path} --field=slug --per-page=999999")
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")
56
56
  if (existingPlugins.to_s.gsub(/\n/, '|').split("|").include?("#{plugin[:slug]}") == false)
57
57
  warn "Pluggin #{plugin[:slug]} not known in wordpress repository. skip installation"
58
58
  next
@@ -65,17 +65,19 @@ namespace "wp-capistrano" do
65
65
 
66
66
  info "install #{plugin[:slug]}:#{plugin[:version]}"
67
67
  if(plugin[:version]) == "latest"
68
- execute "/usr/bin/env php /tmp/wp-cli.phar plugin install #{plugin[:slug]} --path=#{release_path}"
68
+ execute "/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin install #{plugin[:slug]} --path=#{release_path}"
69
+ info "install #{plugin[:slug]}"
69
70
  else
70
- execute "/usr/bin/env php /tmp/wp-cli.phar plugin install #{plugin[:slug]} --path=#{release_path} --version=#{plugin[:version]}"
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]}"
71
73
  end
72
74
  end
73
75
  plugins.each do |plugin|
74
76
  if (plugin[:status] == "active")
75
- execute "/usr/bin/env php /tmp/wp-cli.phar plugin activate #{plugin[:slug]} --path=#{release_path}"
76
- 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]}"
77
79
  else
78
- execute "/usr/bin/env php /tmp/wp-cli.phar plugin deactivate #{plugin[:slug]} --path=#{release_path}"
80
+ execute "/usr/bin/env php #{fetch(:tmp_dir)}/wp-cli.phar plugin deactivate #{plugin[:slug]} --path=#{release_path}"
79
81
  info "deactivate #{plugin[:slug]}"
80
82
  end
81
83
  end
@@ -2,10 +2,11 @@ namespace "wp-capistrano" do
2
2
  desc 'Install wordpress'
3
3
  task :install_wordpress do
4
4
  on roles(:app), filter: :no_release do
5
- execute "rm #{shared_path}/wp-config.php"
6
- execute "php /tmp/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
- execute "cp #{release_path}/wp-config.php #{shared_path}/"
8
- execute "php /tmp/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}"
5
+ if (File.exist?("#{release_path}/wp-config.php") == false)
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
+ execute "cp #{release_path}/wp-config.php #{shared_path}/"
8
+ end
9
+ 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
10
  end
10
11
  end
11
- end
12
+ 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 /tmp/wp-cli.phar core update --path=#{release_path}"
5
+ execute "php #{fetch(:tmp_dir)}/wp-cli.phar core update --path=#{release_path}"
6
6
  end
7
7
  end
8
- end
8
+ end
@@ -1,5 +1,5 @@
1
1
  # Default Flow
2
- before 'deploy:check:linked_files', 'wp-capistrano:create_wp_config'
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
5
  after 'wp-capistrano:install_plugins', 'wp-capistrano:update_wordpress'
@@ -1,4 +1,4 @@
1
- load File.expand_path("../tasks/create_wp_config.rake", __FILE__)
1
+ #load File.expand_path("../tasks/create_wp_config.rake", __FILE__)
2
2
  load File.expand_path("../tasks/download_wordpress.rake", __FILE__)
3
3
  load File.expand_path("../tasks/install_wordpress.rake", __FILE__)
4
4
  load File.expand_path("../tasks/update_wordpress.rake", __FILE__)
@@ -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.16'
7
+ spec.version = '0.0.20'
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.16
4
+ version: 0.0.20
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-19 00:00:00.000000000 Z
11
+ date: 2022-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano