Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cf-deployment-tracker-client

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-deployment-tracker-client - npm Package Compare versions

Comparing version 0.0.8 to 0.1.1

2

package.json
{
"name": "cf-deployment-tracker-client",
"version": "0.0.8",
"version": "0.1.1",
"private": false,

@@ -5,0 +5,0 @@ "main": "tracker.js",

@@ -15,3 +15,6 @@ # Overview

```
3. Add a copy of the Privacy Notice to the readme file.
**Note:** All apps that have deployment tracker must include the Privacy Notice.
# Example app

@@ -31,4 +34,6 @@

* Application URIs (`application_uris`)
* Labels of bound services
* Number of instances for each bound service and associated plan information
This data is collected from the `package.json` file in the sample application and the `VCAP_APPLICATION` environment variable in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
This data is collected from the `package.json` file in the sample application and the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.

@@ -35,0 +40,0 @@ ## Disabling Deployment Tracking

@@ -10,3 +10,4 @@ // Licensed under the Apache 2.0 License. See footer for details.

var pkg = require(path.join(path.dirname(module.parent.filename), 'package.json')),
vcapApplication;
vcapApplication,
vcapServices;

@@ -39,3 +40,28 @@ if (process.env.VCAP_APPLICATION) {

}
if (process.env.VCAP_SERVICES) {
// refer to http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES
vcapServices = JSON.parse(process.env.VCAP_SERVICES);
if(Object.keys(vcapServices).length > 0) {
event.bound_vcap_services = {};
// for each bound service count the number of instances and identify used plans
Object.keys(vcapServices).forEach(function(service_label) {
event.bound_vcap_services[service_label] = {
'count': vcapServices[service_label].length, // number of service_label instances
'plans': [] // (optional) plan information for service_label
};
vcapServices[service_label].forEach(function (serviceInstance) {
if(serviceInstance.hasOwnProperty('plan')) {
event.bound_vcap_services[service_label].plans.push(serviceInstance.plan);
}
});
// Keep plans property only if at least one plan is associated with this service
if(event.bound_vcap_services[service_label].plans.length === 0) {
delete event.bound_vcap_services[service_label].plans;
}
});
}
}
event.runtime = 'nodejs';
var url = 'https://deployment-tracker.mybluemix.net/api/v1/track';

@@ -42,0 +68,0 @@ restler.postJson(url, event).on('complete', function (data) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc