enable analytics

This commit is contained in:
2017-09-08 23:16:09 +02:00
parent 78e6f13adf
commit 6971df069a
8 changed files with 45 additions and 18 deletions

View File

@ -1,5 +1,7 @@
import * as plugins from './npmci.plugins'
import * as paths from './npmci.paths'
import * as npmciMonitor from './npmci.monitor'
npmciMonitor.run()
// Get Info about npmci itself
let npmciInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot)

View File

@ -6,7 +6,8 @@ import { Dockerfile } from './mod_docker/index'
/**
* a info instance about the git respoitory at cwd :)
*/
export let repo: GitRepo
if (process.env.CI_REPOSITORY_URL) {
repo = new GitRepo(process.env.CI_REPOSITORY_URL)
let repoString: string = process.env.CI_REPOSITORY_URL
if (!repoString) {
repoString = 'https://undefined:undefined@github.com/undefined/undefined.git'
}
export let repo = new GitRepo(repoString)

View File

@ -9,8 +9,12 @@ export let npmciAnalytics = new Analytics({
appName: 'npmci'
})
npmciAnalytics.recordEvent('npmToolExecution', {
}).catch(err => {
plugins.beautylog.warn('Lossless Analytics API not available...')
})
export let run = async () => {
npmciAnalytics.recordEvent('npmToolExecution', {
host: env.repo.host,
user: env.repo.user,
repo: env.repo.repo
}).catch(err => {
plugins.beautylog.warn('Lossless Analytics API not available...')
})
}