From 51d980cfb333878c22d6b76e89e1d314facfbfd0 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Fri, 1 Dec 2017 15:33:59 -0500 Subject: [PATCH] Conditionally purge on deploys We can configure this within Travis --- bin/configure-fastly.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/configure-fastly.js b/bin/configure-fastly.js index 657d83c56..6c2bacf11 100644 --- a/bin/configure-fastly.js +++ b/bin/configure-fastly.js @@ -177,10 +177,12 @@ async.auto({ fastly.activateVersion(results.version, function (err, response) { if (err) throw new Error(err); process.stdout.write('Successfully configured and activated version ' + response.number + '\n'); - fastly.purgeAll(FASTLY_SERVICE_ID, function (err) { - if (err) throw new Error(err); - process.stdout.write('Purged all.\n'); - }); + if (process.env.FASTLY_PURGE_ALL) { + fastly.purgeAll(FASTLY_SERVICE_ID, function (err) { + if (err) throw new Error(err); + process.stdout.write('Purged all.\n'); + }); + } }); } }