Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating dotnet-script blog #1077

Merged
merged 4 commits into from
Dec 6, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion blog/2022-07/rfc-migrate-scriptcs-dotnet-script/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ tags:
---

:::warning
We shipped this change as a part of 2023.4. We're aware some customers are having issues updating their machines and scripts. We've re-implemented scriptcs as the default C# scripting engine. The option to continue using dotnet-script is available with a project-specific variable `Octopus.Action.Script.CSharp.UseDotnetScript` and an environment-wide feature toggle `OCTOPUS__FeatureToggle__UseDotnetScriptCSharpExecutorFeatureToggle`. Please contact [support](mailto:[email protected]) if you're experiencing issues or would like dotnet-script enabled. We've created a [public issue](https://github.com/OctopusDeploy/Issues/issues/8359).
We shipped this change as a part of 2023.4. ScriptCS is still included as the default C# scripting engine with the option to use dotnet-script available with a project-specific variable `Octopus.Action.Script.CSharp.UseDotnetScript` and an environment-wide feature toggle `OCTOPUS__FeatureToggles__UseDotnetScriptCSharpExecutorFeatureToggle`. Please contact [support](mailto:[email protected]) if you're experiencing issues or would like dotnet-script enabled.
For further details on upgrading to dotnet-script please see the migration section.
:::

We received [customer feedback](https://help.octopus.com/t/consider-use-dotnet-script-vs-scriptcs/22144) and [UserVoice voting](https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/31454668-allow-the-use-of-c-script-csx-using-net-core) requesting we update the tooling Octopus uses to run C# scripts, from [scriptcs](https://github.com/scriptcs/scriptcs) to [dotnet-script](https://github.com/filipw/dotnet-script). This would:
Expand Down Expand Up @@ -72,6 +73,10 @@ One trade-off of this change is that C# scripting would no longer be available o

#### Migration

This migration to dotnet-script introduces a dependency on net6.0, any Workers or deployment targets running C# scripts using dotnet-script will require the net6.0 SDK on path.

The Octopus class has also been removed from C# scripting, this brings behaviour inline with PowerShell scripts. This changes behaviour like setting variables from `Octopus.SetVariable` to `SetVariable`. Parameters have also been changed from `Octopus.Parameters` to `OctopusParameters`, for a full list of these methods see the [bootstrap code](https://github.com/OctopusDeploy/Calamari/blob/master/source/Calamari.Common/Features/Scripting/DotnetScript/Bootstrap.csx). The old bootstrapper is still available by setting the `Octopus.Action.Script.CSharp.UseOctopusClassBootstrapper` variable, however this is only intended for migration purposes and is due for deprecation in the near future.
TeganAli marked this conversation as resolved.
Show resolved Hide resolved

To run C# scripts against your SSH linux targets, you'd need to reconfigure your SSH targets to use the self-contained Calamari which runs via net6.0. This requires the net6.0 SDK on the machine executing dotnet-script.

To do this, [select the Self-Contained Calamari target runtime on your SSH target](https://octopus.com/docs/infrastructure/deployment-targets/linux/ssh-target#self-contained-calamari). Targets using the Linux tentacle will continue to work as they always have.
Expand Down