-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure deployments and add semantic release
* feat: add serverless config * feat: pick env vars from ssm * fix: await page to launch and change output video/image output to /tmp/ * fix: add client_id * refactor: update webpack config * refactor: set specific hour in yt publish date * feat: setup semantic release * fix: add test script
- Loading branch information
1 parent
c1dc6e9
commit f2b00a9
Showing
11 changed files
with
3,277 additions
and
1,168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ assets | |
.vscode | ||
yarn-error.log | ||
.DS_STORE | ||
coverage | ||
coverage | ||
.serverless | ||
.webpack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = { | ||
plugins: [ | ||
'@semantic-release/commit-analyzer', | ||
'@semantic-release/release-notes-generator', | ||
|
||
[ | ||
'@semantic-release/changelog', | ||
{ | ||
changelogTitle: `# Changelog\n`, | ||
changelogFile: 'CHANGELOG.md', | ||
}, | ||
], | ||
|
||
// deploy the function | ||
[ | ||
'@semantic-release/exec', | ||
{ | ||
prepareCmd: 'yarn deploy', | ||
}, | ||
], | ||
|
||
'@semantic-release/git', | ||
|
||
// publish the release to github with assets | ||
'@semantic-release/github', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
service: dat-song-bot | ||
|
||
plugins: | ||
- serverless-webpack | ||
- serverless-offline | ||
|
||
provider: | ||
name: aws | ||
runtime: nodejs8.10 | ||
stage: ${opt:stage, 'production'} | ||
region: ap-south-1 | ||
environment: | ||
NODE_ENV: 'production' | ||
YOUTUBE_CLIENT_ID: ${ssm:YOUTUBE_CLIENT_ID} | ||
YOUTUBE_CLIENT_SECRET: ${ssm:YOUTUBE_CLIENT_SECRET~true} | ||
YOUTUBE_REFRESH_TOKEN: ${ssm:YOUTUBE_REFRESH_TOKEN~true} | ||
SOUNDCLOUD_CLIENT_ID: ${ssm:SOUNDCLOUD_CLIENT_ID} | ||
UNSPLASH_ACCESS_KEY: ${ssm:UNSPLASH_ACCESS_KEY} | ||
DEBUG: '*Logger' | ||
|
||
package: | ||
exclude: | ||
- node_modules/puppeteer/.local-chromium/** # exclude puppeteer chrome if exists | ||
|
||
custom: | ||
webpack: | ||
packager: 'yarn' | ||
forceInclude: | ||
- '@ffmpeg-installer/ffmpeg' | ||
|
||
functions: | ||
dat-song-bot: | ||
name: dat-song-bot-${self:provider.stage} | ||
description: 'This function generates and uploads a video to youtube!' | ||
memorySize: 1024 | ||
timeout: 900 # 15 minutes | ||
handler: src/index.main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const path = require('path'); | ||
const slsw = require('serverless-webpack'); | ||
const webpack = require('webpack'); | ||
|
||
module.exports = { | ||
entry: slsw.lib.entries, | ||
output: { | ||
libraryTarget: 'commonjs', | ||
path: path.join(__dirname, '.webpack'), | ||
filename: '[name].js', | ||
}, | ||
mode: slsw.lib.webpack.isLocal ? 'development' : 'production', | ||
target: 'node', | ||
resolve: { | ||
extensions: ['.ts', '.js', '.json', 'node'], | ||
}, | ||
optimization: { | ||
nodeEnv: false, | ||
}, | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env.FLUENTFFMPEG_COV': false, | ||
}), | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, | ||
loader: 'ts-loader', | ||
exclude: /node_modules/, | ||
}, | ||
{ | ||
test: /\.node$/, | ||
loader: 'node-loader', | ||
}, | ||
], | ||
}, | ||
externals: { | ||
'chrome-aws-lambda': 'chrome-aws-lambda', | ||
'aws-sdk': 'aws-sdk', | ||
'@ffmpeg-installer/ffmpeg': '@ffmpeg-installer/ffmpeg', | ||
}, | ||
}; |
Oops, something went wrong.