Code Monkey home page Code Monkey logo

capistrano-cachetool's Introduction

Capistrano::Cachetool

Exposes the Cachetool by Goralina in Capistrano 3.x

This plugin is heavily inspired on capistrano/composer.

Installation

Add this line to your application's Gemfile:

gem 'capistrano-cachetool'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano-cachetool

Usage

Require the module in your Capfile:

require 'capistrano/cachetool' capistrano/cachetool comes with 2 tasks:

  • cachetool:install_executable
  • cachetool:run

By default it is assumed that you have the cachetool executable installed and in your $PATH on all target hosts.

Configuration

Configurable options, shown here with defaults:

set :cachetool_roles, :all
set :cachetool_download_url, 'https://gordalina.github.io/cachetool/downloads/cachetool.phar'
set :cachetool_working_dir, -> { fetch(:release_path) }

Installing cachetool as part of a deployment

Add the following to deploy.rb to manage the installation of cachetool during deployment (cachetool.phar is install in the shared path).

SSHKit.config.command_map[:cachetool] = "php #{shared_path.join("cachetool.phar")}"

namespace :deploy do
  after :starting, 'cachetool:install_executable'
end

Accessing cachetool commands directly

This library also provides a cachetool:run task which allows access to any cachetool command.

From the command line you can run

cap production cachetool:run['opcache:status', '--cli']

If you use zsh you will need to wrap the command in quotes:

cap production "cachetool:run['opcache:status', '--cli']" 

Or from within a rake task using capistrano's invoke

task :my_custom_cachetool_task do
  invoke "cachetool:run", :update, "--dev --prefer-dist"
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/tijsverkoyen/capistrano-cachetool/issues.

License

The gem is available as open source under the terms of the MIT License.

capistrano-cachetool's People

Contributors

tijsverkoyen avatar

Stargazers

 avatar

Watchers

 avatar

capistrano-cachetool's Issues

create different versions based on the wished version of cache tool

Latest version of the cache tool (which is taken automatically) does not work with PHP7, making impossible to make deploys of older codebases. Making different versions of the tool, or at least hard choosing a cache tool version would solve this.
(To get around this, I had to fork the project and hardcode the version myself)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.