Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abramstyle/deploy-tools
My deployment utils
https://github.com/abramstyle/deploy-tools
aws deployment
Last synced: 6 days ago
JSON representation
My deployment utils
- Host: GitHub
- URL: https://github.com/abramstyle/deploy-tools
- Owner: abramstyle
- Created: 2019-03-28T06:20:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-28T09:46:13.000Z (almost 6 years ago)
- Last Synced: 2024-08-08T21:10:44.417Z (6 months ago)
- Topics: aws, deployment
- Language: TypeScript
- Size: 176 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deploy tools
Some utils to finish your deployment.
# Upload your file to AWS S3
```ts
const path = require('path');
const { S3Uploader } = require('@abramstyle/deploy-tools');const buildPath = path.resolve(__dirname, '../dist');
const uploadConfig = {
bucket: 'YOUR_BUCKET_NAME',
keyPrefix: 'YOUR_DIRECTORY_PREFIX',
};async function startJob() {
const uploader = new S3Uploader(uploadConfig);uploader.on('success', ({ count, finished, filename }) => {
console.log(`progress: ${finished}/${count}. file ${filename} upload success.`);
});
uploader.on('done', () => {
console.log('uploading finished.');
});await uploader.uploadDir(buildPath);
}console.log('initializing...');
startJob().then(() => {
console.log('start upload...');
}).catch((error) => {
console.error('file upload failed.', error);
});
```## API
### constructor
```ts
interface UploaderConfig {
bucket: string,
keyPrefix: string,
}
```
```ts
public constructor(config: UploaderConfig)
```### uploadFile
```ts
public async uploadFile(filepath: string): Promise
```### uploadDir
```ts
public async uploadDir(distDir: string): Promise
```