How to use the ci-info.name function in ci-info

To help you get started, we’ve selected a few ci-info examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github serverless / serverless / lib / classes / Utils.js View on Github external
numberOfEventsPerType,
            eventNamesPerFunction,
          },
          general: {
            userId,
            context,
            invocationId,
            timestamp: new Date().getTime(),
            timezone: new Date().toString().match(/([A-Z]+[+-][0-9]+)/)[1],
            operatingSystem: process.platform,
            userAgent: process.env.SERVERLESS_DASHBOARD ? 'dashboard' : 'cli',
            serverlessVersion: serverless.version,
            nodeJsVersion: process.version,
            isDockerContainer: isDockerContainer(),
            isCISystem: ci.isCI,
            ciSystem: ci.name,
            isStandaloneExecutable: serverless.isStandaloneExecutable,
          },
        },
      };

      if (config.userId && data.properties && data.properties.general) {
        // add platformId to segment call
        data.properties.general.platformId = config.userId;
      }

      if (provider && provider.name && provider.name.toUpperCase() === 'AWS' && data.properties) {
        data.properties.aws = {
          hasIAMAuthorizer,
          hasCustomAuthorizer,
          hasCognitoAuthorizer,
        };
github alibaba / funcraft / lib / visitor.js View on Github external
async function getVisitor(returnFakeIfMissingConfig = false) {

  if (!visitor) {
    const profile = await getProfileFromFile();

    // use fake if it is in a ci environment or has never been configured
    if (_.isEmpty(profile)) {

      if (detectMocha()) {
        return fakeMocha;
      }

      if (ci.isCI) {
        real.pageview(`/downloaded/ci/${ci.name}`).send();
      }

      return fake;
    }

    if (profile.report === undefined) {
      if (returnFakeIfMissingConfig) { return fake; }

      if (detectMocha()) {
        return fakeMocha;
      }

      visitor = real;
    }

    if (profile.report === true) {
github gucong3000 / gulp-reporter / lib / short-doc-url.js View on Github external
'use strict';
const inGFW = require('in-gfw');
const axios = require('axios');
const ci = require('ci-info');
const locale = require('./locale');

const isInGFW = ci.isCI && ci.name ? Promise.resolve(locale === 'zh_CN') : inGFW('goo.gl', 't.cn');

const shorturlCache = isInGFW.then(inGFW => {
	return require(inGFW ? './shorturl_cn.json' : './shorturl.json');
});

function shortDocUrl (error) {
	if (!error.doc) {
		return error;
	}
	return shortUrl(error.doc).catch(ex => {
		//
	}).then(shortUrl => {
		if (shortUrl) {
			error.docShort = shortUrl;
		}
		return error;
github gucong3000 / gulp-reporter / lib / ci-reporter.js View on Github external
'use strict';
const checkstyleFormatter = require('checkstyle-formatter');
const reportBuilder = require('junit-report-builder');
const yaml = require('js-yaml');
const fs = require('fs-extra');
const axios = require('axios');
const ci = require('ci-info');
const path = require('path');
const url = require('url');
const os = require('os');
const icons = require('./icons');

const privatePrefix = ci.isCI && ci.name && ci.name.replace(/\s*CI$/i, '').toUpperCase() + '_';
const reportPath = path.join.bind(
	path,
	getEnv('REPORTS', 'REPORT_PATH', 'TEST_REPORTS') || circleReportPath() || 'lint-reports'
);

let appveyorApiUrl;

const category = {
	warn: 'Warning',
	info: 'Information',
	error: 'Error',
};
const severity = {
	warn: 'warning',
	info: 'information',
};
github aliyun / serverless-aliyun-function-compute / shared / visitor.js View on Github external
function sendDownloaded() {
  real.pageview('/downloaded').send();
  if (ci.isCI) {
    real.pageview(`/downloaded/ci/${ci.name}`).send();
  }
}

ci-info

Get details about the current Continuous Integration environment

MIT
Latest version published 12 months ago

Package Health Score

80 / 100
Full package analysis