enable analytics
This commit is contained in:
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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...')
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user