added raygun deployment upload

This commit is contained in:
Peli de Halleux 2015-11-13 09:58:40 -08:00
Родитель 25c299bf11
Коммит 9768d5cdc6
1 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -3741,6 +3741,7 @@ function tdupload(args:string[])
console.log("channel: " + resp)
}, 1, { name: channel })
uploadFiles()
uploadRaygunDeployment(liteId, process.env['TRAVIS_COMMIT'], 'travis: ' + process.env['TRAVIS_BUILD_NUMBER'])
}
}, 1, {
releaseid: lbl,
@ -3755,6 +3756,29 @@ function tdupload(args:string[])
}
}
function uploadRaygunDeployment(version: string, commit:string, comment: string) {
if (!process.env['RAYGUN_API_KEY']) return;
console.log('creating raygun deployment');
var body = {
apiKey: process.env['RAYGUN_API_KEY'],
version: version,
ownerName: "travis",
emailAddress: "build@touchdevelop.com",
comment: comment,
scmIdentifier: commit
};
var req = http.request({
protocol: 'https',
host: 'app.raygun.io',
port: '80',
path: '/deployments',
method: "POST",
headers : { 'content-type': 'application/json; charset=utf8' }
});
req.end(JSON.stringify(body))
}
function setlabel(args:string[])
{
var mm = /^(http.*)(\?access_token=.*)/.exec(args[0])