-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
4,857 additions
and
6,704 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Deploy Serverless Functions | ||
|
||
on: | ||
push: | ||
branches: | ||
# Automatically deploy master and staging. Additional branches may be added. | ||
- master | ||
- staging | ||
workflow_dispatch: | ||
# Allows manual build and deploy of any branch/ref | ||
|
||
jobs: | ||
# Deploy Serverless functions | ||
deploy: | ||
name: Deploy | ||
uses: CruGlobal/.github/.github/workflows/deploy-serverless.yml@v1 |
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,19 @@ | ||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [ master, staging ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: 'yarn' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn test |
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 |
---|---|---|
@@ -1 +1 @@ | ||
nodejs 12.18.0 | ||
nodejs 16.14.2 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ module.exports = { | |
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: '12' | ||
node: '16' | ||
} | ||
} | ||
], | ||
|
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,9 @@ | ||
// This file is used by serverless to load environment from .env, and to set environment fields in functions | ||
module.exports = () => { | ||
const { parsed } = require('dotenv').config() | ||
const env = {} | ||
for (const [key, value] of Object.entries(parsed)) { | ||
env[key] = process.env[key] || value | ||
} | ||
return env | ||
} |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"version": "1.0.0", | ||
"private": true, | ||
"description": "A Probot app for merging branches into staging", | ||
"author": "Spencer Oberstadt <[email protected]>", | ||
"author": "Spencer Oberstadt", | ||
"license": "ISC", | ||
"repository": "https://github.com/CruGlobal/github-merge-bot.git", | ||
"homepage": "https://github.com/CruGlobal/github-merge-bot", | ||
|
@@ -30,33 +30,34 @@ | |
"source-map-support": "^0.5.19" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.11.0", | ||
"@babel/preset-typescript": "^7.10.4", | ||
"@types/jest": "^25.1.0", | ||
"@babel/core": "^7.17.9", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/preset-typescript": "^7.16.7", | ||
"@types/jest": "^27.4.1", | ||
"@types/nock": "^11.1.0", | ||
"@types/node": "^12.12.0", | ||
"@typescript-eslint/parser": "^2.4.0", | ||
"babel-loader": "^8.1.0", | ||
"babel-plugin-source-map-support": "^2.1.2", | ||
"dotenv": "^8.2.0", | ||
"@types/node": "^17.0.23", | ||
"@typescript-eslint/parser": "^5.19.0", | ||
"babel-loader": "^8.2.4", | ||
"babel-plugin-source-map-support": "^2.1.3", | ||
"dotenv": "^16.0.0", | ||
"eslint-plugin-typescript": "^0.14.0", | ||
"jest": "^24.9.0", | ||
"nock": "^11.4.0", | ||
"nodemon": "^2.0.0", | ||
"rollbar-sourcemap-webpack-plugin": "^2.5.1", | ||
"serverless": "^1.44.1", | ||
"serverless-offline": "^6.4.0", | ||
"serverless-webpack": "^5.3.1", | ||
"smee-client": "^1.1.0", | ||
"standard": "^14.3.1", | ||
"ts-jest": "^25.1.0", | ||
"typescript": "^3.6.4", | ||
"webpack": "^4.2.0", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-node-externals": "^1.6.0" | ||
"jest": "^27.5.1", | ||
"nock": "^13.2.4", | ||
"nodemon": "^2.0.15", | ||
"rollbar-sourcemap-webpack-plugin": "^3.3.0", | ||
"serverless": "^3.12.0", | ||
"serverless-offline": "^8.5.0", | ||
"serverless-webpack": "^5.7.0", | ||
"smee-client": "^1.2.2", | ||
"standard": "^16.0.4", | ||
"ts-jest": "^27.1.4", | ||
"typescript": "^4.6.3", | ||
"webpack": "^5.72.0", | ||
"webpack-cli": "^4.9.2", | ||
"webpack-node-externals": "^3.0.0" | ||
}, | ||
"engines": { | ||
"node": ">= 12.18.0", | ||
"node": ">= 16.14.0", | ||
"npm": ">= 4.0.0" | ||
}, | ||
"standard": { | ||
|
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 |
---|---|---|
@@ -1,55 +1,61 @@ | ||
service: github-merge-bot | ||
frameworkVersion: '3' | ||
configValidationMode: error | ||
plugins: | ||
- serverless-webpack | ||
- serverless-offline | ||
|
||
provider: | ||
name: aws | ||
stage: ${env:ENVIRONMENT} | ||
runtime: nodejs12.x | ||
region: us-east-1 | ||
vpc: | ||
securityGroupIds: | ||
- ${file(${env:ECS_CONFIG}/bin/vars.yml):us-east-1.webapp_elb_sg} | ||
subnetIds: ${file(${env:ECS_CONFIG}/bin/vars.yml):us-east-1.prod_apps_1_all} | ||
- sg-888294ed | ||
subnetIds: | ||
- subnet-f2c2dfda # us-east-1a | ||
- subnet-1508db62 # us-east-1b | ||
- subnet-3fd94266 # us-east-1c | ||
stackTags: | ||
Name: ${env:PROJECT_NAME}-${self:custom.environmentMap.${env:ENVIRONMENT}} | ||
owner: [email protected] | ||
application: ${env:PROJECT_NAME} | ||
env: ${self:custom.environmentMap.${env:ENVIRONMENT}} | ||
managed_by: serverless-framework | ||
function: lambda | ||
environment: ${file(serverless/environment.js)} | ||
|
||
functions: | ||
mergebot: | ||
handler: src/handlers.probot | ||
memorySize: 192 | ||
timeout: 60 | ||
events: | ||
- http: | ||
path: /bot | ||
method: POST | ||
layers: | ||
- arn:aws:lambda:us-east-1:072686360478:layer:node-16_14_2:1 | ||
environment: ${file(env.js)} | ||
|
||
package: | ||
individually: true | ||
exclude: | ||
- .git/** | ||
- test/** | ||
- '**/*.test.js' | ||
- .deployment/** | ||
|
||
plugins: | ||
- serverless-webpack | ||
- serverless-offline | ||
patterns: | ||
- '!.webpack/**' | ||
- '!test/**' | ||
- '!**/*.test.js' | ||
- '!.deployment/**' | ||
|
||
custom: | ||
webpack: | ||
webpackConfig: ./webpack.config.js | ||
includeModules: true | ||
packager: yarn | ||
excludeFiles: '**/*.test.js' | ||
excludeRegex: \.ts|test|\.map | ||
environmentMap: | ||
production: prod | ||
staging: stage | ||
development: dev | ||
lab: lab | ||
serverless-offline: | ||
httpPort: 4000 | ||
|
||
functions: | ||
mergebot: | ||
handler: src/handlers.probot | ||
memorySize: 192 | ||
timeout: 60 | ||
events: | ||
- http: | ||
path: /bot | ||
method: POST |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.