aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2021-04-18 17:41:58 +1000
committerGitHub <noreply@github.com>2021-04-18 17:41:58 +1000
commit7d22c361d1895dc72e67e3061b8382137d489c25 (patch)
tree6da20a4b952134de1c97b52ecd2119ccdaec7e9b
parent951cccb6b0da4372db05f3696a6b558587b59d12 (diff)
downloadplyr-7d22c361d1895dc72e67e3061b8382137d489c25.tar.lz
plyr-7d22c361d1895dc72e67e3061b8382137d489c25.tar.xz
plyr-7d22c361d1895dc72e67e3061b8382137d489c25.zip
chore: remove fastly purging logic (#2173)
-rw-r--r--package.json4
-rw-r--r--tasks/deploy.js47
2 files changed, 2 insertions, 49 deletions
diff --git a/package.json b/package.json
index ad17e8d9..9186de6c 100644
--- a/package.json
+++ b/package.json
@@ -52,7 +52,6 @@
"del": "^6.0.0",
"eslint": "^7.23.0",
"fancy-log": "^1.3.3",
- "fastly-purge": "^1.0.1",
"git-branch": "^2.0.1",
"gulp": "^4.0.2",
"gulp-awspublish": "^4.1.2",
@@ -88,8 +87,7 @@
"stylelint-config-sass-guidelines": "^8.0.0",
"stylelint-order": "^4.1.0",
"stylelint-scss": "^3.19.0",
- "stylelint-selector-bem-pattern": "^2.1.0",
- "through2": "^4.0.2"
+ "stylelint-selector-bem-pattern": "^2.1.0"
},
"dependencies": {
"core-js": "^3.10.1",
diff --git a/tasks/deploy.js b/tasks/deploy.js
index cfe41cf2..5860f908 100644
--- a/tasks/deploy.js
+++ b/tasks/deploy.js
@@ -14,11 +14,9 @@ const { green, cyan, bold } = require('colorette');
const log = require('fancy-log');
const open = require('gulp-open');
const size = require('gulp-size');
-const through = require('through2');
// Deployment
const aws = require('aws-sdk');
const publish = require('gulp-awspublish');
-const FastlyPurge = require('fastly-purge');
// Configs
const pkg = require('../package.json');
const deploy = require('../deploy.json');
@@ -53,14 +51,6 @@ const paths = {
],
};
-// Get credentials
-let credentials = {};
-try {
- credentials = require('../credentials.json'); //eslint-disable-line
-} catch (e) {
- // Do nothing
-}
-
// Get branch info
const branch = {
current: gitbranch.sync(),
@@ -177,41 +167,6 @@ gulp.task('cdn', (done) => {
);
});
-// Purge the fastly cache incase any 403/404 are cached
-gulp.task('purge', () => {
- if (!Object.keys(credentials).includes('fastly')) {
- throw new Error('Fastly credentials required to purge cache.');
- }
-
- const { fastly } = credentials;
- const list = [];
-
- return gulp
- .src(paths.upload)
- .pipe(
- through.obj((file, enc, cb) => {
- const filename = file.path.split('/').pop();
- list.push(`${versionPath}${filename.replace(minSuffix, '')}`);
- cb(null);
- }),
- )
- .on('end', () => {
- const purge = new FastlyPurge(fastly.token);
-
- list.forEach((url) => {
- log(`Purging ${cyan(url)}...`);
-
- purge.url(url, (error, result) => {
- if (error) {
- log.error(error);
- } else if (result) {
- log(result);
- }
- });
- });
- });
-});
-
// Publish to demo bucket
gulp.task('demo', (done) => {
if (!canDeploy()) {
@@ -271,4 +226,4 @@ gulp.task('open', () => {
});
// Do everything
-gulp.task('deploy', gulp.series('cdn', 'demo', 'purge', 'open'));
+gulp.task('deploy', gulp.series('cdn', 'demo', 'open'));