https://github.com/bigmurry/gulp-oss-sync
A gulp plugin to sync files with Aliyun OSS
https://github.com/bigmurry/gulp-oss-sync
gulp-plugin oss stream
Last synced: 4 months ago
JSON representation
A gulp plugin to sync files with Aliyun OSS
- Host: GitHub
- URL: https://github.com/bigmurry/gulp-oss-sync
- Owner: BigMurry
- License: mit
- Created: 2017-02-24T07:29:53.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-01-13T13:36:00.000Z (about 4 years ago)
- Last Synced: 2024-04-26T18:21:44.569Z (almost 2 years ago)
- Topics: gulp-plugin, oss, stream
- Language: JavaScript
- Size: 207 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-oss-sync
A gulp plugin to sync files with Aliyun OSS
Inspired by [gulp-awspublish](https://github.com/pgherveou/gulp-awspublish)
[](https://nodei.co/npm/gulp-oss-sync/)
## Introduction
Use local cache file to store last published file path and file hash. If the file is in the cache file and the hash is unchanged, then ignore this file.
## Screen shots

## Features
- Use cache file to save network traffic
- Automatic delete useless file in OSS
## How to use
```js
const gulp = require('gulp');
const ossSync = require('gulp-oss-sync');
const ossConf = {
connect: {
"region": "",
"accessKeyId": "",
"accessKeySecret": "",
"bucket": ""
},
controls: {
"headers": {
"Cache-Control": "no-cache"
}
},
setting: {
dir: "foo/bar", // root directory name
noClean: false, // compare with the last cache file to decide if the file deletion is need
force: false, // ignore cache file and force re-upload all the files
quiet: true, // quiet option for oss deleteMulti operation
fileName: (path)=> { return path } // modify oss file path
}
};
const cacheConf = {
cacheFileName: '.oss-cache-test' // the filename for the cache file
};
gulp.task('publish', function () {
return gulp.src(['**/*.png'])
.pipe(ossSync(ossConf, cacheConf));
})
```