aboutsummaryrefslogtreecommitdiffstats
path: root/tasks/deploy.js
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 /tasks/deploy.js
parent951cccb6b0da4372db05f3696a6b558587b59d12 (diff)
downloadplyr-7d22c361d1895dc72e67e3061b8382137d489c25.tar.lz
plyr-7d22c361d1895dc72e67e3061b8382137d489c25.tar.xz
plyr-7d22c361d1895dc72e67e3061b8382137d489c25.zip
chore: remove fastly purging logic (#2173)
Diffstat (limited to 'tasks/deploy.js')
-rw-r--r--tasks/deploy.js47
1 files changed, 1 insertions, 46 deletions
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'));