From 9e08d085d8aca7536753202702304a21ee2f7f14 Mon Sep 17 00:00:00 2001 From: Yann Lugrin Date: Wed, 24 Nov 2021 14:08:12 +0100 Subject: [PATCH] Add cachetool reset task --- lib/capistrano/antistatique/cachetool.rb | 3 +++ lib/capistrano/tasks/cachetool.rake | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 lib/capistrano/antistatique/cachetool.rb create mode 100644 lib/capistrano/tasks/cachetool.rake diff --git a/lib/capistrano/antistatique/cachetool.rb b/lib/capistrano/antistatique/cachetool.rb new file mode 100644 index 0000000..d13b1c0 --- /dev/null +++ b/lib/capistrano/antistatique/cachetool.rb @@ -0,0 +1,3 @@ +require 'capistrano/cachetool' + +load File.expand_path('../../tasks/cachetool.rake', __FILE__) diff --git a/lib/capistrano/tasks/cachetool.rake b/lib/capistrano/tasks/cachetool.rake new file mode 100644 index 0000000..46198fc --- /dev/null +++ b/lib/capistrano/tasks/cachetool.rake @@ -0,0 +1,11 @@ +namespace :cachetool do + namespace :opcache do + task :reset do + on release_roles(fetch(:cachetool_roles)) do + within fetch(:cachetool_working_dir) do + execute :cachetool, "opcache:reset --web --web-path=#{release_path}/web --web-url=#{fetch(:cachetool_reset_web_url)}", raise_on_non_zero_exit: false + end + end + end + end +end \ No newline at end of file