-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2707 from apinf/develop
0.47.0 release
- Loading branch information
Showing
29 changed files
with
1,148 additions
and
198 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 @@ | ||
v4.8.3 |
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,107 @@ | ||
/* Copyright 2017 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */ | ||
|
||
// Inspired by https://goo.gl/Rbd2s2 | ||
|
||
var path = require('path'), | ||
fs = require('fs'), | ||
extend = require('util')._extend, | ||
exec = require('child_process').exec, | ||
processes = []; | ||
|
||
var baseDir = path.resolve(__dirname, '..'), | ||
srcDir = path.resolve(baseDir); | ||
|
||
var appOptions = { | ||
env: { | ||
PORT: 3000, | ||
ROOT_URL: 'http://localhost:3000' | ||
} | ||
}; | ||
|
||
/** | ||
* Start a process on the O.S. | ||
* Optionally start a child process if options.waitForMessage | ||
* is set to an output message emitted by this process. | ||
* | ||
* @param {command, options} opts | ||
* @param {*} callback | ||
*/ | ||
function startProcess(opts, callback) { | ||
var proc = exec( | ||
opts.command, | ||
opts.options | ||
); | ||
|
||
if (opts.waitForMessage) { | ||
proc.stdout.on('data', function waitForMessage(data) { | ||
if (data.toString().match(opts.waitForMessage)) { | ||
if (callback) { | ||
callback(); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
if (!opts.silent) { | ||
proc.stdout.pipe(process.stdout); | ||
proc.stderr.pipe(process.stderr); | ||
} | ||
|
||
if (opts.logFile) { | ||
var logStream = fs.createWriteStream(opts.logFile, {flags: 'a'}); | ||
proc.stdout.pipe(logStream); | ||
proc.stderr.pipe(logStream); | ||
} | ||
|
||
proc.on('close', function(code) { | ||
console.log(opts.name, 'exited with code ' + code); | ||
for (var i = 0; i < processes.length; i += 1) { | ||
processes[i].kill(); | ||
} | ||
process.exit(code); | ||
}); | ||
processes.push(proc); | ||
} | ||
|
||
/** | ||
* Always run meteor in production-like environment | ||
* since we do not want to reload changing files | ||
* | ||
* @param {*} callback | ||
*/ | ||
function startApp(callback) { | ||
startProcess({ | ||
name: 'Meteor App', | ||
command: 'meteor --production', | ||
waitForMessage: appOptions.waitForMessage, | ||
options: { | ||
cwd: srcDir, | ||
env: extend(appOptions.env, process.env) | ||
} | ||
}, callback); | ||
} | ||
|
||
/** | ||
* Start chimp | ||
*/ | ||
function startChimp() { | ||
startProcess({ | ||
name: 'Chimp', | ||
command: 'yarn run chimp-test' | ||
}); | ||
} | ||
|
||
/** | ||
* Run meteor and then chimp after application has started | ||
*/ | ||
function chimpNoMirror() { | ||
appOptions.waitForMessage = 'App running at:'; | ||
startApp(function() { | ||
startChimp(); | ||
}); | ||
} | ||
|
||
chimpNoMirror(); |
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,13 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2017 Apinf Oy | ||
#This file is covered by the EUPL license. | ||
#You may obtain a copy of the licence at | ||
#https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 | ||
|
||
set -ev | ||
|
||
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then | ||
sh -e /etc/init.d/xvfb start | ||
sleep 3 | ||
fi |
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,24 +1,55 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "node" | ||
- '4' | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- sourceline: 'deb https://dl.yarnpkg.com/debian/ stable main' | ||
key_url: 'https://dl.yarnpkg.com/debian/pubkey.gpg' | ||
packages: | ||
- g++-4.8 | ||
- yarn | ||
chrome: stable | ||
|
||
branches: | ||
only: | ||
- develop | ||
|
||
before_cache: | ||
- rm -f $HOME/.meteor/log/*.log | ||
|
||
cache: | ||
yarn: true | ||
|
||
before_install: | ||
- curl -o- -L https://yarnpkg.com/install.sh | bash | ||
- export PATH=$HOME/.yarn/bin:$PATH | ||
directories: | ||
- $HOME/.meteor | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
# Install meteor locally on CI | ||
- if [ ! -e "$HOME/.meteor/meteor" ]; then curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh; fi | ||
|
||
before_script: | ||
- yarn | ||
- yarn run lint | ||
# Start X Virtual Frame Buffer for headless testing with real browsers | ||
- ./.scripts/start-xvfb.sh | ||
|
||
install: | ||
- export PATH="$HOME/.meteor:$PATH" | ||
|
||
script: | ||
# Run meteor and chimp from node.js | ||
- travis_retry yarn test | ||
# Build docker image | ||
- ./.scripts/docker_build.sh | ||
|
||
env: | ||
global: | ||
- DISPLAY=:99.0 | ||
- TEST_MODE: "true" | ||
- CXX=g++-4.8 |
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ <h3> | |
Apinf | ||
</dt> | ||
<dd> | ||
0.46.0 | ||
0.47.0 | ||
</dd> | ||
<dt> | ||
API Umbrella | ||
|
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,36 @@ | ||
/* Copyright 2017 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */ | ||
|
||
// Meteor packages imports | ||
import { Meteor } from 'meteor/meteor'; | ||
import { Accounts } from 'meteor/accounts-base'; | ||
|
||
// Npm packages imports | ||
import Raven from 'raven-js'; | ||
|
||
// Set Global Error Handler | ||
window.addEventListener('error', (e) => { | ||
// Send error message and stack | ||
Raven.captureException(e.message, { extra: { stack: e.error.stack } }); | ||
}); | ||
|
||
// Set Global Error Handler on Promise rejection | ||
window.addEventListener('unhandledrejection', (e) => { | ||
// Send error message and stack | ||
Raven.captureException(e.reason.message, { extra: { stack: e.reason.stack } }); | ||
}); | ||
|
||
// Set Global Handler on Sign in | ||
Accounts.onLogin(() => { | ||
Raven.setUserContext({ | ||
email: Meteor.user().emails[0].address, | ||
id: Meteor.userId(), | ||
}); | ||
}); | ||
|
||
// Set Global Handler on Sign Out | ||
Accounts.onLogout(() => { | ||
Raven.setUserContext(); | ||
}); |
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 @@ | ||
/* Copyright 2017 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */ | ||
|
||
// Meteor packages imports | ||
import { Meteor } from 'meteor/meteor'; | ||
|
||
// Npm packages imports | ||
import Raven from 'raven-js'; | ||
|
||
// APInf imports | ||
import wrapMeteorDebug from './wrap_meteor_debug'; | ||
|
||
Meteor.startup(() => { | ||
Meteor.call('getClientDsn', (err, result) => { | ||
// The falsy result will turn off the Sentry app | ||
const SENTRY_DSN = result || false; | ||
|
||
// Configure Raven capture tracking for Client side | ||
Raven | ||
.config(SENTRY_DSN) | ||
.install(); | ||
}); | ||
|
||
wrapMeteorDebug(); | ||
}); |
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 @@ | ||
/* Copyright 2017 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */ | ||
|
||
// Meteor packages imports | ||
import { Meteor } from 'meteor/meteor'; | ||
|
||
// Npm packages imports | ||
import Raven from 'raven-js'; | ||
|
||
export default function wrapMeteorDebug () { | ||
// Expand Meteor._debug function - capture and log exception to Sentry before display error | ||
const originalMeteorDebug = Meteor._debug; | ||
|
||
Meteor._debug = function (m, s) { | ||
// Exception message contains two message. | ||
// One of them is Exception Tracker which is not useful for debugging | ||
// Don't send exception to Sentry which is related to Tracker exception | ||
if (m !== 'Exception from Tracker recompute function:') { | ||
// Provide message of error and stack | ||
Raven.captureException(m, { extra: { stack: s } }); | ||
} | ||
// eslint-disable-next-line | ||
return originalMeteorDebug.apply(this, arguments); | ||
}; | ||
} |
Oops, something went wrong.