However, I struggle to understand: - how to test i...
# contribute
p
However, I struggle to understand: ā€¢ how to test it locally? the CLI seems to require the provider need to be published in some package registry ā€¢ how to add it to the Pulumi org? I found no guidelines for contributing new providers, except an issue in the bolierplate repo, which is open for a year
f
you can run
pulumi plugin install
with
Copy code
-f, --file string     Install a plugin from a tarball file, instead of downloading it
You don't have to add it to Pulumi org. Can just publish it in your org and use https://github.com/springload/pulumi-tf-provider-ec/blob/master/provider/resources.go#L175 That makes it generate SDKs that reference this URL instead of the default one.
Documentation is a bit hairy here, sometimes you have go through the code and github issues.
b
@fierce-ability-58936 / @plain-quill-22197 please let us know what will help make this easier! Alexey, if you need to jump on a call, I can take you through the process
p
@fierce-ability-58936 thanks, it's very helpful
@broad-dog-22463 maybe following up on this issue would be helpful for people building Pulumi providers https://github.com/pulumi/pulumi-tf-provider-boilerplate/issues/28
b
totally agree - but what specifically would help - "docs" is a broad subject as we both know šŸ™‚ What were the serious pain points for you that you had blocking on etc - I've built 50 of these and each are different due to upstream dependencies etc so trying to get an understanding of what the main issues are and then we can at least add value for our community sooner
p
things like
Copy code
Development

Do this, that, add PluginDownloadURL to resources.go
Use make development
Just skimmed through the makefile, found it
Copy code
development:: install_plugins provider lint_provider build_sdks install_sdks cleanup # Build the provider & SDKs for a development environment
b
@plain-quill-22197 there's a full example of a community provider here: github.com/jaxxstorm/pulumi-rke
p
šŸ‘
thanks
I already made my work and tested it šŸ™‚ still need to adopt the small bits
b
happy to hear it!
p
@billowy-army-68599 have you been able to instruct Pulumi CLI to download your provider when using the .NET stack? I see the download location is specified for all langs except .NET
b
no, you have to do it manually with
pulumi plugin install --server
for the time being
the problem with Go and Dotnet is that the packaging system doesn't allow metadata like node and python do
p
thanks, I thought so
for .NET though I think it could be a custom build target
b
can you elaborate? I'm open to any suggestions here to get this fixed
p
For example, this code added to the csproj file runs
yarn install
when the project builds
Copy code
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
        <Exec Command="node --version" ContinueOnError="true">
            <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
        </Exec>
        <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project." />
        <Message Importance="high" Text="Restoring dependencies using 'yarn'. This may take several minutes..." />
        <Exec WorkingDirectory="$(SpaRoot)" Command="yarn install" />
    </Target>
it's possible to include a custom target in a library package, so then the package gets installed, the target is included, like Adam Ralph did with MinVer https://github.com/adamralph/minver/blob/main/MinVer/MinVer.csproj