Cake addin for add & modify Octopus variables
C# PowerShell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Cake.OctoVariapus
test/Cake.OctoVariapus.Tests
.gitignore
Cake.OctoVariapus.sln
LICENSE
README.md
appveyor.yml
build.cake
build.ps1
variables.json

README.md

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")