Last active
December 15, 2015 02:19
-
-
Save PaulStovell/5186220 to your computer and use it in GitHub Desktop.
How Octopus will invoke ScriptCS scripts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tentacle run-script -f Hello.csx -v Hello=Bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file is generated | |
#load "P:\\GitHub\\Octopus\\source\\Octopus.Tentacle\\bin\\Configure.41aa7a71-af29-4e8d-9539-615b498a37a9.csx" | |
#load "P:\\GitHub\\Octopus\\source\\Octopus.Tentacle\\bin\\Deploy.csx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file is generated | |
using System; | |
public static class Octopus | |
{ | |
public static readonly OctopusParametersDictionary Parameters = new OctopusParametersDictionary(); | |
public class OctopusParametersDictionary : System.Collections.Generic.Dictionary<string,string> | |
{ | |
public OctopusParametersDictionary() : base(System.StringComparer.OrdinalIgnoreCase) | |
{ | |
// Variables: | |
this[System.Text.Encoding.UTF8.GetString(Convert.FromBase64String( "SGVsbG8=" ) )] = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String( "QmFy" ) ); | |
} | |
public string Hello { get { return this[System.Text.Encoding.UTF8.GetString(Convert.FromBase64String( "SGVsbG8=" ) )]; } } | |
} | |
// Functions: | |
static string EncodeServiceMessageValue(string value) | |
{ | |
var valueBytes = System.Text.Encoding.UTF8.GetBytes(value); | |
return Convert.ToBase64String(valueBytes); | |
} | |
public static void SetOctopusVariable(string name, string value) | |
{ | |
name = EncodeServiceMessageValue(name); | |
value = EncodeServiceMessageValue(value); | |
Console.WriteLine("##octopus[setVariable name='$name' value='$value']"); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the user's script: | |
using System; | |
Console.WriteLine("Hello! " + Octopus.Parameters["Hello"]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@PaulStovell, am I supposed to be able to call
Octopus.SetOctopusVariable(name, value)
from my PreDeploy/Deploy? Tentacle crashes when I do it.