Skip to content

Commit

Permalink
Sandbox migration (#465)
Browse files Browse the repository at this point in the history
* adding sandbox change migration

* adding winston slack logger

* v2.10.1
  • Loading branch information
LeonFedotov authored Oct 5, 2017
1 parent e08c2eb commit 4953854
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 50 deletions.
14 changes: 11 additions & 3 deletions libs/logger.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const path = require('path');
const winston = require('winston');
const assert = require('assert');
const sprintf = require("sprintf-js").sprintf;
const sprintf = require('sprintf-js').sprintf;
const dateFormat = require('dateformat');
const Slack = require('winston-slack-transport');

module.exports = function (module) {
assert(module);
Expand All @@ -13,13 +14,20 @@ module.exports = function (module) {

var logger = new winston.Logger({
transports: [
new Slack({
webhook_url: 'https://hooks.slack.com/services/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',
channel: '#devops-log',
username: 'ErrorBot',
level: 'info',
handleExceptions: true
}),
new (winston.transports.Console)({
timestamp: function () {
return dateFormat(Date.now(), "dd/mm/yy hh:MM:ss.l");
return dateFormat(Date.now(), 'dd/mm/yy hh:MM:ss.l');
},
formatter: function (options) {
// Return string will be passed to logger.
return sprintf("%-33s", options.timestamp() + ' ' + options.level.toUpperCase() + ' ' + id + ' : ') + (options.message ? options.message : '') +
return sprintf('%-33s', options.timestamp() + ' ' + options.level.toUpperCase() + ' ' + id + ' : ') + (options.message ? options.message : '') +
(options.meta && Object.keys(options.meta).length ? '\n\t' + JSON.stringify(options.meta) : '');
}
})
Expand Down
15 changes: 15 additions & 0 deletions migrations/20171006005624_sandbox2017.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

exports.down = function(knex, Promise) {

};

exports.up = function (knex, Promise) {
return Promise.all([
knex('events').insert({
event_id: "SANDBOX2017",
gate_code: "171819",
name: "Sandbox 2017 ארגז חול",
gate_status: "early_arrival"
})
]);
};
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"this is part of the deployment proess, so it is important to update the version number",
"version name corresponds to the github release name / tag name - https://github.com/Midburn/Spark/releases"
],
"version": "2.10.0",
"version": "2.10.1",
"private": true,
"scripts": {
"postinstall": "bower install",
Expand Down Expand Up @@ -87,12 +87,13 @@
"request": "^2.74.0",
"requirejs": "^2.3.2",
"serve-favicon": "~2.4.3",
"snyk": "^1.34.4",
"sprintf-js": "1.0.3",
"sqlite3": "^3.1.8",
"superagent": "^3.5.0",
"webpack": "^1.14.0",
"winston": "2.3.0",
"snyk": "^1.34.4",
"winston-slack-transport": "^2.0.0",
"xml2js-parser": "^1.1.1"
},
"devDependencies": {
Expand Down
74 changes: 29 additions & 45 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1166,13 +1166,13 @@ [email protected]:
dependencies:
ms "0.7.2"

[email protected], debug@^2.1.2:
[email protected], debug@^2.1.2, debug@^2.1.3, debug@^2.2.0:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
dependencies:
ms "2.0.0"

debug@^2.1.1, debug@^2.1.3, debug@^2.2.0, debug@~2.6.7:
debug@^2.1.1, debug@~2.6.7:
version "2.6.8"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
dependencies:
Expand Down Expand Up @@ -1220,14 +1220,10 @@ delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"

[email protected], depd@~1.1.1:
[email protected], depd@~1.1.0, depd@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359"

depd@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3"

destroy@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
Expand Down Expand Up @@ -1525,11 +1521,7 @@ esutils@^2.0.0, esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"

etag@~1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.0.tgz#6f631aef336d6c46362b51764044ce216be3c051"

etag@~1.8.1:
etag@~1.8.0, etag@~1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"

Expand Down Expand Up @@ -2191,14 +2183,10 @@ i18next@^8.2.1:
version "8.2.1"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-8.2.1.tgz#6d2e8884516c320b4020c5af63e0316be626ac95"

[email protected], iconv-lite@^0.4.4:
[email protected], iconv-lite@^0.4.4, iconv-lite@~0.4.13:
version "0.4.19"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"

iconv-lite@~0.4.13:
version "0.4.15"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb"

ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
Expand Down Expand Up @@ -2680,13 +2668,7 @@ kind-of@^2.0.1:
dependencies:
is-buffer "^1.0.2"

kind-of@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47"
dependencies:
is-buffer "^1.0.2"

kind-of@^3.2.2:
kind-of@^3.0.2, kind-of@^3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
dependencies:
Expand Down Expand Up @@ -2998,23 +2980,23 @@ mime-db@~1.30.0:
version "1.30.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01"

mime-types@^2.1.10, mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.7:
version "2.1.14"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.14.tgz#f7ef7d97583fcaf3b7d282b6f8b5679dab1e94ee"
mime-types@^2.1.10, mime-types@^2.1.12, mime-types@~2.1.16:
version "2.1.17"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a"
dependencies:
mime-db "~1.26.0"
mime-db "~1.30.0"

mime-types@~2.1.15:
mime-types@~2.1.11, mime-types@~2.1.15:
version "2.1.15"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed"
dependencies:
mime-db "~1.27.0"

mime-types@~2.1.16:
version "2.1.17"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a"
mime-types@~2.1.7:
version "2.1.14"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.14.tgz#f7ef7d97583fcaf3b7d282b6f8b5679dab1e94ee"
dependencies:
mime-db "~1.30.0"
mime-db "~1.26.0"

[email protected]:
version "1.4.1"
Expand Down Expand Up @@ -3502,11 +3484,7 @@ parse-passwd@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6"

parseurl@~1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56"

parseurl@~1.3.2:
parseurl@~1.3.1, parseurl@~1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3"

Expand Down Expand Up @@ -3728,11 +3706,11 @@ punycode@~1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.2.4.tgz#54008ac972aec74175def9cba6df7fa9d3918740"

[email protected]:
[email protected], qs@^6.0.2, qs@^6.1.0:
version "6.5.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"

qs@^6.0.2, qs@^6.1.0, qs@~6.4.0:
qs@~6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"

Expand Down Expand Up @@ -3930,7 +3908,7 @@ repeating@^2.0.0:
dependencies:
is-finite "^1.0.0"

request@2, request@^2.61.0, request@^2.74.0, request@^2.79.0:
request@2, request@^2.61.0, request@^2.67.0, request@^2.74.0, request@^2.79.0:
version "2.81.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
dependencies:
Expand Down Expand Up @@ -4046,11 +4024,11 @@ rx@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782"

[email protected], safe-buffer@^5.0.1:
[email protected]:
version "5.0.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7"

[email protected]:
[email protected], safe-buffer@^5.0.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"

Expand Down Expand Up @@ -4842,11 +4820,11 @@ [email protected], util@^0.10.3:
dependencies:
inherits "2.0.1"

[email protected], [email protected]:
[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8"

[email protected]:
[email protected], [email protected]:
version "1.0.1"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"

Expand Down Expand Up @@ -4978,6 +4956,12 @@ window-size@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075"

winston-slack-transport@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/winston-slack-transport/-/winston-slack-transport-2.0.0.tgz#85693c85be4fe9473d48abd6196acb7e58e065a5"
dependencies:
request "^2.67.0"

[email protected]:
version "2.3.0"
resolved "https://registry.yarnpkg.com/winston/-/winston-2.3.0.tgz#207faaab6fccf3fe493743dd2b03dbafc7ceb78c"
Expand Down

0 comments on commit 4953854

Please sign in to comment.