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

asimov-deploy-ui

Package Overview
Dependencies
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asimov-deploy-ui - npm Package Compare versions

Comparing version 0.10.2 to 0.10.3

25

app/services/slack-client.js
var https = require('https');
var _ = require('underscore');

@@ -10,3 +11,3 @@ var _colors = {

var _eventNames = {
var _slackDisplayEventNames = {
startDeployLifecycleCommand: 'releasing',

@@ -17,2 +18,9 @@ completeDeployLifecycleCommand: 'finished',

var _lifeCycleNames = {
startDeployLifecycleCommand: 'started',
completeDeployLifecycleCommand: 'completed',
cancelDeployLifecycleCommand: 'cancelled'
};
function postToSlack(urlToken, body) {

@@ -49,6 +57,7 @@ var postData = JSON.stringify(body);

var featureToggle = require('./../feature-toggle').create(config);
var slackConfig = featureToggle.getActiveFeature('Slack');
var lifecycleConfig = featureToggle.getActiveFeature('lifecycleControls') || {};
var slackConfig = lifecycleConfig.Slack || {};
this.send = function (eventName, eventBody, deployId) {
if (slackConfig.enabled !== true) {
if (lifecycleConfig.enabled !== true) {
return;

@@ -62,3 +71,4 @@ }

var slackEventName = _eventNames[eventName];
var lifeCycleEventName = _lifeCycleNames[eventName];
var slackEventName = _slackDisplayEventNames[eventName];
var username = deployData.user;

@@ -80,3 +90,8 @@ var title = deployData.data.title;

postToSlack(slackConfig.urlToken, body);
for (var i = slackConfig.channels.length - 1; i >= 0; i--) {
var channel = slackConfig.channels[i];
if (_.contains(channel.events, lifeCycleEventName)){
postToSlack(channel.urlToken, body);
}
}
};

@@ -83,0 +98,0 @@ };

18

config.example.json

@@ -29,3 +29,15 @@ {

"lifecycleControls": {
"enabled": true
"enabled": true,
"Slack": {
"channels": [
{
"urlToken": "T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"events": ["started", "completed", "cancelled"]
},
{
"urlToken": "T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"events": ["completed"]
}
]
}
},

@@ -39,6 +51,2 @@ "deployAnnotations": {

"enabled" : true
},
"Slack": {
"urlToken": "T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"enabled" : false
}

@@ -45,0 +53,0 @@ },

@@ -5,3 +5,3 @@ {

"author": "Ebay Inc",
"version": "0.10.2",
"version": "0.10.3",
"homepage": "https://github.com/asimov-deploy/asimov-deploy",

@@ -8,0 +8,0 @@ "license": "Apache-2.0",

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