Programmatically get Turpentine to apply VCL to Varnish from the commandline

87 views Asked by At

I'm deploying a server using Ansible. I would like to get Turpentine to apply VCL from the command line so that when I first visit the new server it's already using the correctly compiled VCL for that environment.

1

There are 1 answers

0
JaseC On

Run a command like php ~/applyvcl.php

and in the php file:

<?php
require_once '/path/to/magento/app/Mage.php';
Mage::app('admin');
$res = Nexcessnet_Turpentine_Model_Varnish_Admin::applyConfig();
var_dump($res);     
?>

You should see success message from that.