Skip to content

Commit f0f7414

Browse files
committed
Fix semantics for creating a server object
Update packages Update README Update version
1 parent d71247f commit f0f7414

7 files changed

Lines changed: 32 additions & 29 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ ScriptCs.OctoClient
55
This is an Octopus Client [Script Pack](https://github.com/scriptcs/scriptcs/wiki) for [scriptcs](https://github.com/scriptcs/scriptcs) that can be used to interact with an Octopus Deploy server using the Octopus API.
66

77
## Installation
8-
Install the NuGet package by running `scriptcs -install ScriptCs.OctopusClient -pre`
8+
Install the NuGet package by running `scriptcs -install ScriptCs.OctopusClient`
99

1010
## Usage
1111

1212
``` csharp
1313
var octopus = Require<OctopusClientPack>();
14-
var repo = octopus.Initialise("http://server/octopusdeploy/api", "API-XXXXXXXXXXXXXXXXXXXXXXXXXXX");
14+
var server = octopus.Server("http://server/octopusdeploy/api", "API-XXXXXXXXXXXXXXXXXXXXXXXXXXX");
1515
Console.WriteLine("Getting the current user...");
16-
var user = repo.Users.GetCurrent();
16+
var user = server.Users.GetCurrent();
1717
Console.WriteLine("Current user: {0}", user.DisplayName);
1818
Console.WriteLine("Getting your dashboard...");
19-
var dashboard = repo.Dashboards.GetDashboard();
19+
var dashboard = server.Dashboards.GetDashboard();
2020
foreach(var item in dashboard.Items)
2121
{
22-
var project = repo.Projects.Get(item.ProjectId);
23-
var environment = repo.Environments.Get(item.EnvironmentId);
22+
var project = server.Projects.Get(item.ProjectId);
23+
var environment = server.Environments.Get(item.EnvironmentId);
2424
Console.WriteLine("Project: {0} -> Environment: {1} -> Release Version: {2}", project.Name, environment.Name, item.ReleaseVersion);
2525
}
2626
```
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net45" />
4-
<package id="Octopus.Client" version="2.5.3.245" targetFramework="net40" />
5-
<package id="ScriptCs.Contracts" version="0.9.0" targetFramework="net45" />
6-
<package id="ScriptCs.OctopusClient" version="0.1.0" targetFramework="net45" />
3+
<package id="Newtonsoft.Json" version="6.0.5" targetFramework="net45" />
4+
<package id="Octopus.Client" version="2.5.8.447" targetFramework="net40" />
5+
<package id="ScriptCs.Contracts" version="0.10.2" targetFramework="net45" />
6+
<package id="ScriptCs.OctopusClient" version="0.1.1" targetFramework="net45" />
77
<package id="Sprache" version="1.10.0.37" targetFramework="net40" />
88
</packages>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
var octopus = Require<OctopusClientPack>();
2-
var repo = octopus.Initialise("http://server/octopusdeploy/api", "API-XXXXXXXXXXXXXXXXXXXXXXXXXXX");
2+
var server = octopus.Server("http://server/octopusdeploy/api", "API-XXXXXXXXXXXXXXXXXXXXXXXXXXX");
33
Console.WriteLine("Getting the current user...");
4-
var user = repo.Users.GetCurrent();
4+
var user = server.Users.GetCurrent();
55
Console.WriteLine("Current user: {0}", user.DisplayName);
66
Console.WriteLine("Getting your dashboard...");
7-
var dashboard = repo.Dashboards.GetDashboard();
7+
var dashboard = server.Dashboards.GetDashboard();
88
foreach(var item in dashboard.Items)
99
{
10-
var project = repo.Projects.Get(item.ProjectId);
11-
var environment = repo.Environments.Get(item.EnvironmentId);
10+
var project = server.Projects.Get(item.ProjectId);
11+
var environment = server.Environments.Get(item.EnvironmentId);
1212
Console.WriteLine("Project: {0} -> Environment: {1} -> Release Version: {2}", project.Name, environment.Name, item.ReleaseVersion);
1313
}

src/ScriptCs.OctopusClient/OctopusClientPack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class OctopusClientPack : IScriptPackContext
1010
{
1111
private IOctopusClient _client;
1212

13-
public OctopusRepository Initialise(string hostUrl, string apiKey)
13+
public OctopusRepository Server(string hostUrl, string apiKey)
1414
{
1515
var endpoint = new OctopusServerEndpoint(hostUrl, apiKey);
1616
var repository = new OctopusRepository(endpoint);

src/ScriptCs.OctopusClient/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
[assembly: Guid("2bd92078-7efd-4c16-898e-f995bcbe0d58")]
1717

18-
[assembly: AssemblyVersion("0.1.0")]
19-
[assembly: AssemblyFileVersion("0.1.0")]
20-
[assembly: AssemblyInformationalVersion("0.1.0")]
18+
[assembly: AssemblyVersion("0.1.1")]
19+
[assembly: AssemblyFileVersion("0.1.1")]
20+
[assembly: AssemblyInformationalVersion("0.1.1")]

src/ScriptCs.OctopusClient/ScriptCs.OctopusClient.csproj

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,19 @@
3434
<ItemGroup>
3535
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
3636
<SpecificVersion>False</SpecificVersion>
37-
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
37+
<HintPath>..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll</HintPath>
3838
</Reference>
39-
<Reference Include="Octopus.Client">
40-
<HintPath>..\packages\Octopus.Client.2.5.3.245\lib\net40\Octopus.Client.dll</HintPath>
39+
<Reference Include="Octopus.Client, Version=2.5.8.0, Culture=neutral, processorArchitecture=MSIL">
40+
<SpecificVersion>False</SpecificVersion>
41+
<HintPath>..\packages\Octopus.Client.2.5.8.447\lib\net40\Octopus.Client.dll</HintPath>
4142
</Reference>
42-
<Reference Include="Octopus.Platform">
43-
<HintPath>..\packages\Octopus.Client.2.5.3.245\lib\net40\Octopus.Platform.dll</HintPath>
43+
<Reference Include="Octopus.Platform, Version=2.5.8.0, Culture=neutral, processorArchitecture=MSIL">
44+
<SpecificVersion>False</SpecificVersion>
45+
<HintPath>..\packages\Octopus.Client.2.5.8.447\lib\net40\Octopus.Platform.dll</HintPath>
4446
</Reference>
45-
<Reference Include="ScriptCs.Contracts">
46-
<HintPath>..\packages\ScriptCs.Contracts.0.9.0\lib\net45\ScriptCs.Contracts.dll</HintPath>
47+
<Reference Include="ScriptCs.Contracts, Version=0.10.0.0, Culture=neutral, processorArchitecture=MSIL">
48+
<SpecificVersion>False</SpecificVersion>
49+
<HintPath>..\packages\ScriptCs.Contracts.0.10.2\lib\net45\ScriptCs.Contracts.dll</HintPath>
4750
</Reference>
4851
<Reference Include="Sprache">
4952
<HintPath>..\packages\Sprache.1.10.0.37\lib\net40\Sprache.dll</HintPath>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net45" />
4-
<package id="Octopus.Client" version="2.5.3.245" targetFramework="net45" />
5-
<package id="ScriptCs.Contracts" version="0.9.0" targetFramework="net45" />
3+
<package id="Newtonsoft.Json" version="6.0.5" targetFramework="net45" />
4+
<package id="Octopus.Client" version="2.5.8.447" targetFramework="net45" />
5+
<package id="ScriptCs.Contracts" version="0.10.2" targetFramework="net45" />
66
<package id="Sprache" version="1.10.0.37" targetFramework="net45" />
77
</packages>

0 commit comments

Comments
 (0)