Socket
Socket
Sign inDemoInstall

cloud-cd

Package Overview
Dependencies
215
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cloud-cd

This module abstracts continuous delivery to multiple clouds


Version published
Weekly downloads
10
decreased by-9.09%
Maintainers
2
Install size
127 MB
Created
Weekly downloads
 

Readme

Source

cloud-cd

This module abstracts the process of continuous delivery on multiple clouds.

Resources

  • pkgcloud: This module uses pkgcloud for creating and managing resources on different clouds.

Known Issues

This package currently uses CatalystCode/pkgcloud directly to enable azure ARM. Once the pull request is merged, the relevant dependency should also be updated.

Currently supports Windows Server 2012 and up for running remote commands (using SSH).

Usage

  1. Create a service principal
  2. Create a resource group in azure (i.e. "resources-rg")
  3. Create the following config (edit to match your account's info):

// This is an example of the values you need to insert (it will not work as is)
// Make sure to update all values with your relevant data
var config = {
  azure: {
    connection: {
      provider: 'azure-v2',
      subscriptionId: "e9be1fc6-cb43-4830-99f9-0251055fecec",  
      resourceGroup: "resources-rg",

      servicePrincipal: {
        clientId: "2285862c-d875-45f2-a53a-57d7a5b76606",
        secret: "FIUH34R98HSsdfHF9438swoieFNcij3SffsSf45nJFl=",
        domain: "06f306c4-bc72-4ad4-99ac-a6b5f4b56cc9"
      }
    },
    server: {
      name:  'vm-name',
      flavor: 'Standard_D1',
      username:  'cloudcdusr',
      password:  'Cloudcdusr!!',

      storageOSDiskName: "osdisk",
      storageDataDiskNames: [ "datadisk1" ],

      osType: 'Linux',
      imagePublisher: "Canonical",
      imageOffer: "UbuntuServer",
      imageSku: "16.04.0-LTS",
      imageVersion: "latest"
    }
  }
}
  1. Execute the following command:
var cloudCD = require('cloud-cd');

var getVMClient = new cloudCD.GetVMAction(config.azure.connection);
getVMClient.perform(config.azure.server, (err, server) => {
  if (err) {
    return console.error(err);
  }
  console.dir(server);
});

var createVMClient = new cloudCD.CreateVMAction(config.azure.connection);
createVMClient.perform(config.azure.server, (err, server) => {
  if (err) {
    return console.error(err);
  }
  console.dir(server);
});

var remoteExecuteClient = new cloudCD.RemoteExecute(config.azure.connection);
// Windows remote execute sample
var ps_script = path.join(__dirname, 'scripts', 'dummy.ps1');
remoteExecuteClient.perform(config.azure.server2, { script: ps_script }, (err, outputs) => {
  if (err) {
    return console.error(err);
  }
});

// Linux remote execute sample
var ssh_script = path.join(__dirname, 'scripts', 'demo.sh');
remoteExecuteClient.perform(config.azure.server, { script: ssh_script }, (err, outputs) => {
  if (err) {
    return console.error(err);
  }
});

var destroyVMClient = new cloudCD.DestroyVMAction(config.azure.connection);
destroyVMClient.perform(config.azure.server, (err) => {
  if (err) {
    return console.error(err);
  }
});

Lisence

MIT

Keywords

FAQs

Last updated on 10 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc