capistrano-forkcms 2.0.0 → 2.0.1
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/.gitignore +3 -1
- data/.travis.yml +2 -2
- data/Gemfile +8 -3
- data/{LICENSE.txt → LICENSE.md} +1 -1
- data/Rakefile +7 -4
- data/capistrano-forkcms.gemspec +1 -1
- data/lib/capistrano/forkcms.rb +5 -4
- data/lib/capistrano/forkcms/defaults.rb +11 -12
- data/lib/capistrano/forkcms/version.rb +1 -1
- data/lib/capistrano/tasks/configure.rake +4 -4
- data/lib/capistrano/tasks/opcache.rake +13 -11
- data/lib/capistrano/tasks/symlink.rake +4 -4
- metadata +5 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c7d10d03ae8938d1dd1a20ebd66c571fccfa1243
         | 
| 4 | 
            +
              data.tar.gz: abcce021846282cf0488c407b1dd091e9cca9e21
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e0e3f61c2e8ab875930efc25ceeecd25ce30a1a3bd1b6a13076ebca4eb4d159507b3941de72ef7278478030f150a4c50d690a8572834e08cdfee036d7fc43d20
         | 
| 7 | 
            +
              data.tar.gz: 23ee1c1b6f7cd2bb43f3095d08f171d0afee184f58d089f6e195a392c6c45f684a76e13c13e2cf85f4bbec0adacdd8a522ea8c2664f7aae01258baf997367610
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/.travis.yml
    CHANGED
    
    
    
        data/Gemfile
    CHANGED
    
    | @@ -1,8 +1,13 @@ | |
| 1 | 
            -
             | 
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
            source "https://rubygems.org"
         | 
| 2 3 |  | 
| 3 4 | 
             
            # Specify your gem's dependencies in capistrano-forkcms.gemspec
         | 
| 4 | 
            -
            gemspec
         | 
| 5 | 
            -
             | 
| 6 5 | 
             
            gem 'capistrano', '~> 3.1'
         | 
| 7 6 | 
             
            gem 'capistrano-composer', '~> 0.0.6'
         | 
| 8 7 | 
             
            gem 'capistrano-cachetool', '~> 1.0.0'
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            group :development do
         | 
| 10 | 
            +
                gem 'rake', '~> 12.0'
         | 
| 11 | 
            +
                gem 'rspec', '~> 3.0'
         | 
| 12 | 
            +
            end
         | 
| 13 | 
            +
             | 
    
        data/{LICENSE.txt → LICENSE.md}
    RENAMED
    
    
    
        data/Rakefile
    CHANGED
    
    | @@ -1,6 +1,9 @@ | |
| 1 | 
            -
            require  | 
| 2 | 
            -
            require  | 
| 1 | 
            +
            require 'bundler'
         | 
| 2 | 
            +
            require 'bundler/gem_tasks'
         | 
| 3 | 
            +
            require 'rspec/core/rake_task'
         | 
| 3 4 |  | 
| 4 | 
            -
            RSpec::Core::RakeTask.new(:spec | 
| 5 | 
            +
            RSpec::Core::RakeTask.new(:test) do |spec|
         | 
| 6 | 
            +
              spec.pattern = "spec/**/*_spec.rb"
         | 
| 7 | 
            +
            end
         | 
| 5 8 |  | 
| 6 | 
            -
            task :default => : | 
| 9 | 
            +
            task :default => :test
         | 
    
        data/capistrano-forkcms.gemspec
    CHANGED
    
    | @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| | |
| 19 19 | 
             
              end
         | 
| 20 20 | 
             
              spec.require_paths = ["lib"]
         | 
| 21 21 |  | 
| 22 | 
            -
              spec.add_development_dependency "bundler", "~> 1. | 
| 22 | 
            +
              spec.add_development_dependency "bundler", "~> 1.14"
         | 
| 23 23 | 
             
              spec.add_development_dependency "rake", "~> 10.0"
         | 
| 24 24 | 
             
              spec.add_development_dependency "rspec", "~> 3.0"
         | 
| 25 25 |  | 
    
        data/lib/capistrano/forkcms.rb
    CHANGED
    
    | @@ -1,13 +1,14 @@ | |
| 1 | 
            -
            require  | 
| 2 | 
            -
            require  | 
| 1 | 
            +
            require 'rake'
         | 
| 2 | 
            +
            require 'capistrano/composer'
         | 
| 3 | 
            +
            require 'capistrano/cachetool'
         | 
| 3 4 |  | 
| 4 5 | 
             
            namespace :load do
         | 
| 5 6 | 
             
              task :defaults do
         | 
| 6 7 | 
             
                set :php_bin_path, -> {
         | 
| 7 8 | 
             
                  php_bin_path = fetch(:php_bin_custom_path)
         | 
| 8 | 
            -
                  php_bin_path ||=  | 
| 9 | 
            +
                  php_bin_path ||= 'php'
         | 
| 9 10 | 
             
                }
         | 
| 10 11 |  | 
| 11 | 
            -
                load  | 
| 12 | 
            +
                load 'capistrano/forkcms/defaults.rb'
         | 
| 12 13 | 
             
              end
         | 
| 13 14 | 
             
            end
         | 
| @@ -1,27 +1,26 @@ | |
| 1 1 | 
             
            # Set some Capistrano defaults
         | 
| 2 2 | 
             
            set :linked_files, []
         | 
| 3 | 
            -
            set :linked_files, | 
| 3 | 
            +
            set :linked_files,  %w(app/config/parameters.yml)
         | 
| 4 4 | 
             
            set :linked_dirs, []
         | 
| 5 | 
            -
            set :linked_dirs,  | 
| 6 | 
            -
             | 
| 5 | 
            +
            set :linked_dirs, %w(app/logs app/sessions src/Frontend/Files)
         | 
| 7 6 |  | 
| 8 7 | 
             
            # Run required tasks after the stage
         | 
| 9 8 | 
             
            Capistrano::DSL.stages.each do |stage|
         | 
| 10 | 
            -
              after stage,  | 
| 11 | 
            -
              after stage,  | 
| 9 | 
            +
              after stage, 'forkcms:configure:composer'
         | 
| 10 | 
            +
              after stage, 'forkcms:configure:cachetool'
         | 
| 12 11 | 
             
            end
         | 
| 13 12 |  | 
| 14 13 |  | 
| 15 14 | 
             
            # Make sure the composer executable is installed
         | 
| 16 15 | 
             
            namespace :deploy do
         | 
| 17 | 
            -
              after :starting,  | 
| 18 | 
            -
              after :starting,  | 
| 19 | 
            -
              after :publishing,  | 
| 20 | 
            -
              after :publishing,  | 
| 16 | 
            +
              after :starting, 'composer:install_executable'
         | 
| 17 | 
            +
              after :starting, 'cachetool:install_executable'
         | 
| 18 | 
            +
              after :publishing, 'forkcms:symlink:document_root'
         | 
| 19 | 
            +
              after :publishing, 'forkcms:opcache:reset'
         | 
| 21 20 | 
             
            end
         | 
| 22 21 |  | 
| 23 22 |  | 
| 24 23 | 
             
            # Load the tasks
         | 
| 25 | 
            -
            load File.expand_path( | 
| 26 | 
            -
            load File.expand_path( | 
| 27 | 
            -
            load File.expand_path( | 
| 24 | 
            +
            load File.expand_path('../../tasks/configure.rake', __FILE__)
         | 
| 25 | 
            +
            load File.expand_path('../../tasks/opcache.rake', __FILE__)
         | 
| 26 | 
            +
            load File.expand_path('../../tasks/symlink.rake', __FILE__)
         | 
| @@ -32,12 +32,12 @@ namespace :forkcms do | |
| 32 32 | 
             
                    if test("[ -L #{fetch :document_root} ]") && capture("readlink -- #{fetch :document_root}") == "#{current_path}/"
         | 
| 33 33 | 
             
                      # all is well, the symlink is correct
         | 
| 34 34 | 
             
                    elsif test("[ -d #{fetch :document_root} ]") || test("[ -f #{fetch :document_root} ]")
         | 
| 35 | 
            -
                      error  | 
| 36 | 
            -
                      error  | 
| 35 | 
            +
                      error 'Document root #{fetch :document_root} already exists.'
         | 
| 36 | 
            +
                      error 'To link it, issue the following command:'
         | 
| 37 37 | 
             
                      error "ln -sf #{current_path}/ #{fetch :document_root}"
         | 
| 38 38 | 
             
                    else
         | 
| 39 | 
            -
                      execute :mkdir,  | 
| 40 | 
            -
                      execute :ln,  | 
| 39 | 
            +
                      execute :mkdir, '-p', File.dirname(fetch(:document_root))
         | 
| 40 | 
            +
                      execute :ln, '-sf', "#{current_path}/", fetch(:document_root)
         | 
| 41 41 | 
             
                    end
         | 
| 42 42 | 
             
                  end
         | 
| 43 43 | 
             
                end
         | 
| @@ -4,37 +4,39 @@ namespace :forkcms do | |
| 4 4 | 
             
                  Reset the opcache
         | 
| 5 5 | 
             
                DESC
         | 
| 6 6 | 
             
                task :reset do
         | 
| 7 | 
            -
                  if fetch(:opcache_reset_strategy) ===  | 
| 8 | 
            -
                    invoke  | 
| 9 | 
            -
                  elsif fetch(:opcache_reset_strategy) ===  | 
| 10 | 
            -
                    invoke  | 
| 7 | 
            +
                  if fetch(:opcache_reset_strategy) === 'file'
         | 
| 8 | 
            +
                    invoke 'forkcms:opcache:reset_with_file'
         | 
| 9 | 
            +
                  elsif fetch(:opcache_reset_strategy) === 'fcgi'
         | 
| 10 | 
            +
                    invoke 'forkcms:opcache:reset_with_fcgi'
         | 
| 11 | 
            +
                  elseif fetch(:opcache_reset_strategy) === 'none'
         | 
| 12 | 
            +
                    # do nothing
         | 
| 11 13 | 
             
                  else
         | 
| 12 | 
            -
                    raise  | 
| 14 | 
            +
                    raise 'Invalid value for :opcache_reset_strategy, possible values are: file, fcgi, none.'
         | 
| 13 15 | 
             
                  end
         | 
| 14 16 | 
             
                end
         | 
| 15 17 |  | 
| 16 18 | 
             
                task :reset_with_file do
         | 
| 17 19 | 
             
                  # make sure that we have all needed variables
         | 
| 18 | 
            -
                  raise  | 
| 20 | 
            +
                  raise 'opcache_reset_base_url not set' unless fetch(:opcache_reset_base_url)
         | 
| 19 21 |  | 
| 20 22 | 
             
                  on roles(:web) do
         | 
| 21 23 | 
             
                    stream = StringIO.new("<?php clearstatcache(true); if (function_exists('opcache_reset')) { opcache_reset(); }")
         | 
| 22 24 | 
             
                    upload! stream, "#{current_path}/php-opcache-reset.php"
         | 
| 23 | 
            -
                    execute :curl,  | 
| 25 | 
            +
                    execute :curl, '-L --fail --silent --show-error', "#{fetch :opcache_reset_base_url}/php-opcache-reset.php"
         | 
| 24 26 | 
             
                    execute :rm, "#{current_path}/php-opcache-reset.php"
         | 
| 25 27 | 
             
                  end
         | 
| 26 28 | 
             
                end
         | 
| 27 29 |  | 
| 28 30 | 
             
                task :reset_with_fcgi do
         | 
| 29 31 | 
             
                  # make sure that we have all needed variables
         | 
| 30 | 
            -
                  raise  | 
| 32 | 
            +
                  raise 'opcache_reset_fcgi_connection_string not set' unless fetch(:opcache_reset_fcgi_connection_string)
         | 
| 31 33 |  | 
| 32 | 
            -
                  invoke  | 
| 34 | 
            +
                  invoke 'cachetool:run', 'opcache:reset', "--fcgi=#{fetch :opcache_reset_fcgi_connection_string}"
         | 
| 33 35 |  | 
| 34 36 | 
             
                  # reenable our command, see https://github.com/capistrano/capistrano/issues/1686 for more information
         | 
| 35 | 
            -
                  Rake::Task[ | 
| 37 | 
            +
                  Rake::Task['cachetool:run'].reenable
         | 
| 36 38 |  | 
| 37 | 
            -
                  invoke  | 
| 39 | 
            +
                  invoke 'cachetool:run', 'stat:clear', "--fcgi=#{fetch :opcache_reset_fcgi_connection_string}"
         | 
| 38 40 | 
             
                end
         | 
| 39 41 | 
             
              end
         | 
| 40 42 | 
             
            end
         | 
| @@ -9,12 +9,12 @@ namespace :forkcms do | |
| 9 9 | 
             
                    if test("[ -L #{fetch :document_root} ]") && capture("readlink -- #{fetch :document_root}") == "#{current_path}/"
         | 
| 10 10 | 
             
                      # all is well, the symlink is correct
         | 
| 11 11 | 
             
                    elsif test("[ -d #{fetch :document_root} ]") || test("[ -f #{fetch :document_root} ]")
         | 
| 12 | 
            -
                      error  | 
| 13 | 
            -
                      error  | 
| 12 | 
            +
                      error 'Document root #{fetch :document_root} already exists.'
         | 
| 13 | 
            +
                      error 'To link it, issue the following command:'
         | 
| 14 14 | 
             
                      error "ln -sf #{current_path}/ #{fetch :document_root}"
         | 
| 15 15 | 
             
                    else
         | 
| 16 | 
            -
                      execute :mkdir,  | 
| 17 | 
            -
                      execute :ln,  | 
| 16 | 
            +
                      execute :mkdir, '-p', File.dirname(fetch(:document_root))
         | 
| 17 | 
            +
                      execute :ln, '-sf', "#{current_path}/", fetch(:document_root)
         | 
| 18 18 | 
             
                    end
         | 
| 19 19 | 
             
                  end
         | 
| 20 20 | 
             
                end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: capistrano-forkcms
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2.0. | 
| 4 | 
            +
              version: 2.0.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Tijs Verkoyen
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2017- | 
| 11 | 
            +
            date: 2017-07-26 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - "~>"
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: '1. | 
| 19 | 
            +
                    version: '1.14'
         | 
| 20 20 | 
             
              type: :development
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - "~>"
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: '1. | 
| 26 | 
            +
                    version: '1.14'
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: rake
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -106,7 +106,7 @@ files: | |
| 106 106 | 
             
            - ".rspec"
         | 
| 107 107 | 
             
            - ".travis.yml"
         | 
| 108 108 | 
             
            - Gemfile
         | 
| 109 | 
            -
            - LICENSE. | 
| 109 | 
            +
            - LICENSE.md
         | 
| 110 110 | 
             
            - README.md
         | 
| 111 111 | 
             
            - Rakefile
         | 
| 112 112 | 
             
            - capistrano-forkcms.gemspec
         |