Cake.OctoVariapus

Package Description


Keywords
cake-build, cake-plugin, octopus-deploy, octopus-variables
License
MIT
Install
Install-Package Cake.OctoVariapus -Version 1.2.1

Documentation

Cake.OctoVariapus Build status NuGet version

Cake

Cake integration for Octopus variable management

#addin nuget:?package=Cake.OctoVariapus

Usage

Passing Collection

OctoImportVariables(octopusUrl,
                octoProjectName,
                octoApiKey,
                new List<OctoVariable>
                {
                    new OctoVariable
                    {
                        Name = "ConnectionString",
                        IsSensitive = false,
                        IsEditable = true,
                        Value = "DataSource:localhost25",
                        Scopes = new List<OctoScope>
                        {
                            new OctoScope
                            {
                                Name = "Environment",
                                Values = new List<string> { "Development", "Stage" }
                            },
                            new OctoScope
                            {
                                Name = "Role",
                                Values = new List<string> { "Development" }
                            }
                        }
                    }
                })

With Json File

[
  {
    "Name": "ProductApiEndPoint",
    "Value": "http://www.developmentProductApi.com",
    "IsSensitive": false,
    "IsEditable": true,
    "Scopes": [
      {
        "Name": "Environment",
        "Values": [
          "Development"
        ]
      }
    ]
  },
  {
    "Name": "ProductApiEndPoint",
    "Value": "http://www.stageProductApi.com",
    "IsSensitive": false,
    "IsEditable": true,
    "Scopes": [
      {
        "Name": "Environment",
        "Values": [
          "Stage"
        ]
      }
    ]
  },
  {
    "Name": "ProductApiEndPoint",
    "Value": "http://www.productionProductApi.com",
    "IsSensitive": false,
    "IsEditable": true,
    "Scopes": [
      {
        "Name": "Environment",
        "Values": [
          "Production"
        ]
      }
    ]
  },
  {
    "Name": "ConnectionIsSafe",
    "Value": "true",
    "IsSensitive": false,
    "IsEditable": true,
    "Scopes": [
      {
        "Name": "Environment",
        "Values": [
          "Development",
          "Stage",
          "Production"
        ]
      },
      {
        "Name": "Role",
        "Values": [
          "Development"
        ]
      },
      {
        "Name": "Machine",
        "Values": [
          "Oguzhan's Machine Group"
        ]
      },
      {
        "Name": "Step",
        "Values": [
          "1. Initial"
        ]
      }
    ]
  }
]

Execution:

OctoImportVariables(octopusUrl,
                octoProjectName,
                octoApiKey,
                "./variables.json")