Sha256: 05eccf3eeeb64254f0d66f14077e78a2a2272b20e950146d9a676c58828dbba2

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

namespace "wp-capistrano" do
  desc 'Install plugins dependencies using composer'
  task :plugins_composer_install do
      on roles(:app) do
        pluginDirectory = "../app/web/wp-content/plugins/"

        Dir.foreach(pluginDirectory) { |directory| 
          if (directory != "." and directory != "..")
            puts "#################################\n# Plugin #{directory}\n#################################" 
            Dir.chdir(pluginDirectory + directory) do
              puts 
              if (Dir.exist?(Dir.pwd + '/vendor') == false && File.exist?(Dir.pwd + '/composer.lock') == true)
                puts '=> NEED INSTALL : There is no vendor installed and composer.lock'
                execute "ls #{release_path}/wp-content/plugins/"
                execute "composer install --working-dir=#{release_path}/wp-content/plugins/" + directory
              else
                puts '=> NO NEED INSTALL'
              end
            end

            puts ' '
          end
        }
        
        puts "#################################\n#End Install Plugins\n#################################"
      end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wp-capistrano3-0.0.33 lib/capistrano/tasks/plugins_composer_install.rake
wp-capistrano3-0.0.32 lib/capistrano/tasks/plugins_composer_install.rake
wp-capistrano3-0.0.31 lib/capistrano/tasks/plugins_composer_install.rake
wp-capistrano3-0.0.30 lib/capistrano/tasks/plugins_composer_install.rake