From fce7c0cd9befe7321e0aeb09396afc5dcb8e161d Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Fri, 29 Apr 2016 15:40:44 -0400 Subject: [PATCH] Purge all after configuring Fastly --- README.md | 15 ++++++++------- bin/configure-fastly.js | 4 ++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9d1fd9cfa..58e9a780f 100644 --- a/README.md +++ b/README.md @@ -70,13 +70,14 @@ pip install -r requirements.txt make deploy ``` -| Variable | Default | Description | -| ----------------------- | ------- | ----------------------------------------------- | -| `FASTLY_SERVICE_ID` | `''` | Fastly service ID for `bin/configure-fastly.js` | -| `FASTLY_API_KEY` | `''` | Fastly API key for `bin/configure-fastly.js` | -| `AWS_ACCESS_KEY_ID` | `''` | AWS access key id for S3 | -| `AWS_SECRET_ACCESS_KEY` | `''` | AWS secret access key for S3 | -| `S3_BUCKET_NAME` | `''` | S3 bucket name to deploy into | +| Variable | Default | Description | +| ------------------------ | ------- | ------------------------------------------------ | +| `FASTLY_SERVICE_ID` | `''` | Fastly service ID for `bin/configure-fastly.js` | +| `FASTLY_API_KEY` | `''` | Fastly API key for `bin/configure-fastly.js` | +| `FASTLY_ACTIVATE_CHANGES`| `false` | Activate changes and purge all after configuring | +| `AWS_ACCESS_KEY_ID` | `''` | AWS access key id for S3 | +| `AWS_SECRET_ACCESS_KEY` | `''` | AWS secret access key for S3 | +| `S3_BUCKET_NAME` | `''` | S3 bucket name to deploy into | ### Current issues with the development diff --git a/bin/configure-fastly.js b/bin/configure-fastly.js index e45c2d303..8366960be 100644 --- a/bin/configure-fastly.js +++ b/bin/configure-fastly.js @@ -255,6 +255,10 @@ 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'); + }); }); } }