-
Notifications
You must be signed in to change notification settings - Fork 2
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
Samir Musali
committed
Jan 24, 2020
0 parents
commit 6527297
Showing
9 changed files
with
699 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
version: 2.1 | ||
tagged_build_filters: &tagged_build_filters | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /v[0-9]+\.[0-9]+\.[0-9]+/ | ||
test_build_filters: &test_build_filters | ||
branches: | ||
only: /.*/ | ||
tags: | ||
ignore: /v[0-9]+\.[0-9]+\.[0-9]+/ | ||
jobs: | ||
test: | ||
docker: | ||
- image: circleci/node:10 | ||
steps: | ||
- checkout | ||
- run: npm install | ||
- run: npm run lint | ||
build: | ||
docker: | ||
- image: circleci/node:10 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Check Tagged Push | ||
command: | | ||
PKG_VERSION=$(cat ./package.json | grep version | cut -d '"' -f4) | ||
if [[ "${CIRCLE_TAG}" != "v${PKG_VERSION}" ]]; then | ||
echo "There is mismatch:" | ||
echo " TAG_VERSION: ${CIRCLE_TAG}" | ||
echo " PKG_VERSION: v${PKG_VERSION}" | ||
exit 1 | ||
fi | ||
- run: | ||
name: Build S3 Lambda | ||
command: | | ||
npm install --production | ||
zip logdna-s3.zip -r node_modules/ index.js package.json | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- ./logdna-s3.zip | ||
approve: | ||
machine: true | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- ./logdna-s3.zip | ||
release: | ||
docker: | ||
- image: circleci/golang:1.12 | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
- run: go get -u github.com/tcnksm/ghr | ||
- run: | ||
name: Create a Release | ||
command: | | ||
ghr \ | ||
-n "LogDNA S3 Lambda Function ${CIRCLE_TAG}" \ | ||
-t ${GITHUB_TOKEN} \ | ||
-u ${CIRCLE_PROJECT_USERNAME} \ | ||
-r ${CIRCLE_PROJECT_REPONAME} \ | ||
-draft ${CIRCLE_TAG} ${CIRCLE_WORKING_DIRECTORY} | ||
workflows: | ||
update: | ||
jobs: | ||
- test: | ||
filters: *tagged_build_filters | ||
- build: | ||
requires: | ||
- test | ||
filters: *tagged_build_filters | ||
- approve: | ||
type: approval | ||
requires: | ||
- build | ||
filters: *tagged_build_filters | ||
- release: | ||
requires: | ||
- approve | ||
filters: *tagged_build_filters | ||
test: | ||
jobs: | ||
- test: | ||
filters: *test_build_filters |
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,207 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"globals": { | ||
"debug": false | ||
}, | ||
"rules": { | ||
"accessor-pairs": 0, | ||
"array-bracket-spacing": [2, "never"], | ||
"array-callback-return": 2, | ||
"arrow-parens": ["error", "as-needed", { | ||
"requireForBlockBody": true | ||
}], | ||
"block-scoped-var": 2, | ||
"block-spacing": [2, "always"], | ||
"brace-style": [2, "1tbs", { | ||
"allowSingleLine": true | ||
}], | ||
"class-methods-use-this": [0, { | ||
"exceptMethods": [] | ||
}], | ||
"comma-dangle": [2, "never"], | ||
"comma-spacing": [2, { | ||
"before": false, | ||
"after": true | ||
}], | ||
"comma-style": [2, "first"], | ||
"complexity": [0, 11], | ||
"consistent-return": 0, | ||
"consistent-this": [2, "that"], | ||
"curly": [2, "multi-line"], | ||
"default-case": 0, | ||
"dot-location": [2, "property"], | ||
"dot-notation": [1, { | ||
"allowKeywords": true | ||
}], | ||
"eol-last": 2, | ||
"eqeqeq": [2, "always", { | ||
"null": "ignore" | ||
}], | ||
"guard-for-in": 2, | ||
"indent": [1, 4, { | ||
"FunctionDeclaration": { | ||
"parameters": "first" | ||
}, | ||
"FunctionExpression": { | ||
"parameters": "first" | ||
}, | ||
"SwitchCase": 1 | ||
}], | ||
"key-spacing": [0, { | ||
"align": "colon", | ||
"afterColon": true | ||
}], | ||
"keyword-spacing": [2, { | ||
"overrides": { | ||
"else": { | ||
"before": true | ||
}, | ||
"while": { | ||
"before": true | ||
}, | ||
"catch": { | ||
"before": true | ||
} | ||
} | ||
}], | ||
"max-len": [1, 160, 2, { | ||
"ignoreComments": true | ||
}], | ||
"no-alert": 1, | ||
"no-caller": 2, | ||
"no-case-declarations": 2, | ||
"no-cond-assign": [2, "except-parens"], | ||
"no-const-assign": "error", | ||
"no-div-regex": 0, | ||
"no-else-return": 0, | ||
"no-empty-function": [2, { | ||
"allow": ["arrowFunctions", "functions", "methods"] | ||
}], | ||
"no-empty-pattern": 2, | ||
"no-eq-null": 0, | ||
"no-eval": 2, | ||
"no-extend-native": 2, | ||
"no-extra-bind": 2, | ||
"no-extra-label": 2, | ||
"no-fallthrough": 1, | ||
"no-floating-decimal": 2, | ||
"no-global-assign": [2, { | ||
"exceptions": [] | ||
}], | ||
"no-implicit-coercion": [0, { | ||
"boolean": false, | ||
"number": true, | ||
"string": true, | ||
"allow": [] | ||
}], | ||
"no-implicit-globals": 0, | ||
"no-implied-eval": 2, | ||
"no-invalid-this": 0, | ||
"no-iterator": 2, | ||
"no-labels": [2, { | ||
"allowLoop": false, | ||
"allowSwitch": false | ||
}], | ||
"no-lone-blocks": 2, | ||
"no-loop-func": 1, | ||
"no-magic-numbers": [1, { | ||
"ignore": [0, 1, -1, 2, 3, 4, 5, 6, 7, 8, 9, | ||
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, | ||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, | ||
32, 50, 80, 100, 443, 8080, 8090, | ||
1024, 2048, 4096, 8192, | ||
200, 201, 202, 204, 301, 302, 400, 401, 403, 404, 405, 409, 410, 415, 500, 505, | ||
30, 60, 120, 180, 240, 300, 900, 1800, 3600, 7200, 14400, 43200, 86400, 172800, | ||
1000, 2000, 2500, 3000, 5000, 10000, 30000, 32000, 60000, 120000, 180000, 240000, 300000, 900000, 1800000, 3600000, 7200000, 14400000, 43200000, 86400000, 172800000], | ||
"ignoreArrayIndexes": true, | ||
"enforceConst": false, | ||
"detectObjects": false | ||
}], | ||
"no-mixed-spaces-and-tabs": 2, | ||
"no-multi-spaces": 2, | ||
"no-multi-str": 2, | ||
"no-native-reassign": 0, | ||
"no-new": 0, | ||
"no-new-func": 2, | ||
"no-new-wrappers": 2, | ||
"no-octal": 2, | ||
"no-octal-escape": 2, | ||
"no-param-reassign": 0, | ||
"no-proto": 2, | ||
"no-redeclare": 2, | ||
"no-restricted-properties": [2, { | ||
"object": "arguments", | ||
"property": "callee", | ||
"message": "arguments.callee is deprecated," | ||
}, { | ||
"property": "__defineGetter__", | ||
"message": "Please use Object.defineProperty instead." | ||
}, { | ||
"property": "__defineSetter__", | ||
"message": "Please use Object.defineProperty instead." | ||
}], | ||
"no-return-assign": 2, | ||
"no-script-url": 2, | ||
"no-self-assign": 2, | ||
"no-self-compare": 2, | ||
"no-sequences": 2, | ||
"no-spaced-func": 2, | ||
"no-throw-literal": 2, | ||
"no-trailing-spaces": 2, | ||
"no-undef": 2, | ||
"no-unmodified-loop-condition": 0, | ||
"no-unused-expressions": [2, { | ||
"allowShortCircuit": false, | ||
"allowTernary": false | ||
}], | ||
"no-unused-labels": 2, | ||
"no-unused-vars": [1, { | ||
"vars": "local", | ||
"args": "none" | ||
}], | ||
"no-use-before-define": [2, { | ||
"functions": false | ||
}], | ||
"no-useless-call": 0, | ||
"no-useless-concat": 2, | ||
"no-useless-escape": 2, | ||
"no-void": 2, | ||
"no-warning-comments": [0, { | ||
"terms": ["todo", "fixme", "xxx"], | ||
"location": "start" | ||
}], | ||
"no-with": 2, | ||
"one-var": [0, { | ||
"uninitialized": "always", | ||
"initialized": "never" | ||
}], | ||
"operator-linebreak": [2, "after"], | ||
"padded-blocks": [0, "never"], | ||
"quote-props": [1, "consistent-as-needed"], | ||
"quotes": [1, "single"], | ||
"radix": 0, | ||
"semi": [2, "always"], | ||
"semi-spacing": [2, { | ||
"before": false, | ||
"after": true | ||
}], | ||
"space-before-blocks": [2, "always"], | ||
"space-before-function-paren": [2, "never"], | ||
"space-in-parens": [2, "never"], | ||
"space-infix-ops": 2, | ||
"space-unary-ops": [2, { | ||
"words": false, | ||
"nonwords": false | ||
}], | ||
"spaced-comment": [2, "always"], | ||
"vars-on-top": 0, | ||
"wrap-iife": [2, "outside", { | ||
"functionPrototypeMethods": false | ||
}], | ||
"yoda": 0 | ||
} | ||
} |
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 @@ | ||
# No Package Lock | ||
package-lock.json | ||
|
||
# No Temporary File | ||
*.swp | ||
.DS_Store | ||
|
||
# No NPM Modules | ||
node_modules | ||
|
||
# No ZIP Files | ||
*.zip | ||
|
||
# No Testing Materials | ||
data | ||
generateData.js |
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,6 @@ | ||
# CHANGELOG | ||
|
||
This file documents all notable changes in the `LogDNA S3 Lambda Function`. The release numbering uses [semantic versioning](http://semver.org). | ||
|
||
## v1.0.0 - Released on January 24, 2020 | ||
* Initial Release |
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,15 @@ | ||
# Contributing | ||
|
||
## Github Workflow | ||
|
||
Contributions are always welcome! Be sure to follow the [github workflow](https://guides.github.com/introduction/flow/) when contributing to this project: | ||
|
||
* Create an issue, or comment on an issue to indicate what you are working on. This avoids work duplication. | ||
* Fork the repository and clone to your local machine | ||
* You should already be on the default branch `master` - if not, check it out (`git checkout master`) | ||
* Create a new branch for your feature/fix `git checkout -b my-new-feature`) | ||
* Write your feature/fix | ||
* Stage the changed files for a commit (`git add .`) | ||
* Commit your files with a *useful* commit message ([example](https://github.com/Azure/azure-quickstart-templates/commit/53699fed9983d4adead63d9182566dec4b8430d4)) (`git commit`) | ||
* Push your new branch to your GitHub Fork (`git push origin my-new-feature`) | ||
* Visit this repository in GitHub and create a Pull Request. |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 LogDNA, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.