Skip to content

Commit

Permalink
feat: rebrand to official symbiosis packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjydev committed Jan 25, 2023
1 parent 8adb279 commit 79f96ec
Show file tree
Hide file tree
Showing 60 changed files with 183 additions and 121 deletions.
12 changes: 6 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG UBUNTU_VERSION=latest
FROM ubuntu:${UBUNTU_VERSION}

RUN useradd -ms /bin/bash hayden -u 1000
RUN useradd -ms /bin/bash build -u 1000

# Update apt-get and install various needed utilities
RUN apt-get update && \
Expand All @@ -22,13 +22,13 @@ RUN rm -rf /usr/local/go && \
tar -C /usr/local -xzf ${GO_VERSION}.tar.gz && \
rm ${GO_VERSION}.tar.gz

ENV GOPATH=/home/hayden/go
ENV GOPATH=/home/build/go
ENV PATH=$PATH:/usr/local/go/bin

# Install go linter
RUN mkdir -p $GOPATH/bin && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.46.2 && \
chown -R hayden:hayden $GOPATH
chown -R build:build $GOPATH

ENV PATH=$PATH:$GOPATH/bin

Expand Down Expand Up @@ -63,7 +63,7 @@ RUN apt-get update && \
apt-get install -y dotnet-sdk-6.0

# Install Pulumi
RUN curl -fsSL https://get.pulumi.com | sh && mv /root/.pulumi /home/hayden/ && chown -R hayden:hayden /home/hayden/.pulumi
ENV PATH=$PATH:/home/hayden/.pulumi/bin
RUN curl -fsSL https://get.pulumi.com | sh && mv /root/.pulumi /home/build/ && chown -R build:build /home/build/.pulumi
ENV PATH=$PATH:/home/build/.pulumi/bin

USER hayden
USER build
4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/hugo
{
"name": "TFProvider",
"build": {
"dockerfile": "Dockerfile"
}
}
}
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ env:
PYPI_USERNAME: "__token__"
PYPI_REPOSITORY_URL: ""
PUBLISH_PYPI: true

jobs:
publish_binary:
name: publish
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ builds:
- linux
ldflags:
# The line below MUST align with the module in current provider/go.mod
- -X github.com/kuraudo-io/pulumi-symbiosis/provider/pkg/version.Version={{.Tag }}
- -X github.com/symbiosis-cloud/pulumi-symbiosis/provider/pkg/version.Version={{.Tag }}
main: ./cmd/pulumi-resource-symbiosis/
changelog:
skip: true
Expand Down
47 changes: 47 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Build

## Locally

In order to build the provider locally for testing, you can use the included dev
container setup in [`.devcontainer/`](./.devcontainer). Running it with VS Code
is the easiest method, but you can also run it from a terminal:

```shell
docker build . -f .devcontainer/Dockerfile -t dcps
...
docker run --rm -it -v $(pwd):/build -w /build dcps
build@368612b0ea8c:/build$
```

Once you're in the container, you can use the included [`Makefile`](./Makefile)
to build the SDKs included (Node.js, Python, .NET Core and Golang) by running
the `build` target.

```shell
build@368612b0ea8c:/build$ make build
...
```

Once this has completed, you will see a `dotnet`, `go`, `nodejs` and `python`
folder appear in the [`sdk`](./sdk) directory. These are the compiled/generated
SDKs for use with Pulumi.

## Release

To make a release, there is a two-step process to go through. The first step is
making tags for the releases.

```shell
$ git tag v1.0.2 # used for the nodejs, python and dotnet releases
$ git tag sdk/v1.0.2 # used for the golang release
```

Then, you just need to push your tags.

```shell
$ git push --tags
```

Once done, [GitHub Actions](./.github/workflows/release.yaml) will take over and
(assuming you have set up the required environment variables on GitHub's end)
build & release the SDKs to NPM, PyPI, and NuGet.
16 changes: 16 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Installing the Provider

Because this provider is not an official Pulumi provider, you will need to
manually install the provider wherever you want to use it.

To do this, download an appropriate binary from the Releases section of this
repo (i.e. `linux-amd64` on an x86_64 Linux system, `darwin-arm64` on Apple
Silicon), extract it, and then use the `pulumi plugin install` command to
install it.

```shell
$ pulumi plugin install resource symbiosis v1.0.2 -f ./bin/pulumi-resource-symbiosis
[resource plugin symbiosis-1.0.2] installing
```

Now, you should be able to use the provider through any of its published SDKs.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ PROJECT_NAME := symbiosis Package

SHELL := /usr/bin/bash
PACK := symbiosis
ORG := kuraudo-io
ORG := symbiosis-cloud
PROJECT := github.com/${ORG}/pulumi-${PACK}
NODE_MODULE_NAME := @kuraudo-io/${PACK}
NODE_MODULE_NAME := @symbiosis-cloud/${PACK}
TF_NAME := ${PACK}
PROVIDER_PATH := provider
VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ This package is available for several languages/platforms:
To use from JavaScript or TypeScript in Node.js, install using either `npm`:

```bash
npm install @kuraudo-io/symbiosis
npm install @symbiosis-cloud/symbiosis
```

or `yarn`:

```bash
yarn add @kuraudo-io/symbiosis
yarn add @symbiosis-cloud/symbiosis
```

### Python

To use from Python, install using `pip`:

```bash
pip install kuraudo_symbiosis
pip install symbiosis_pulumi
```

### Go

To use from Go, use `go get` to grab the latest version of the library:

```bash
go get github.com/kuraudo-io/symbiosis/sdk/go/...
go get github.com/symbiosis-cloud/pulumi-symbiosis/sdk/go/...
```

### .NET

To use from .NET, install using `dotnet add package`:

```bash
dotnet add package Kuraudo.Symbiosis
dotnet add package Symbiosis.SymbiosisPulumi
```

## Configuration
Expand Down
8 changes: 4 additions & 4 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The Symbiosis provider must be configured with credentials to deploy and update

```typescript
import * as pulumi from "@pulumi/pulumi";
import * as symbiosis from "@kuraudo-io/symbiosis";
import * as symbiosis from "@symbiosis/symbiosis-pulumi";

const mysite = new symbiosis.Cluster("example", {
region: "germany-1"
Expand All @@ -25,7 +25,7 @@ const mysite = new symbiosis.Cluster("example", {
{{% choosable language python %}}

```python
import kuraudo_symbiosis as symbiosis
import symbiosis_pulumi as symbiosis

db = symbiosis.Cluster("example",
region="germany-1"
Expand All @@ -37,7 +37,7 @@ db = symbiosis.Cluster("example",

```go
import (
"github.com/kuraudo-io/pulumi-symbiosis/sdk/go/symbiosis"
"github.com/symbiosis/pulumi-symbiosis/sdk/go/symbiosis"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

Expand All @@ -59,7 +59,7 @@ func main() {

```csharp
using Pulumi;
using Kuraudo.Symbiosis;
using Symbiosis.Symbiosis;

class ExampleCluster : Stack
{
Expand Down
4 changes: 2 additions & 2 deletions provider/cmd/pulumi-resource-symbiosis/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package main
import (
_ "embed"

symbiosis "github.com/kuraudo-io/pulumi-symbiosis/provider"
"github.com/kuraudo-io/pulumi-symbiosis/provider/pkg/version"
symbiosis "github.com/symbiosis-cloud/pulumi-symbiosis/provider"
"github.com/symbiosis-cloud/pulumi-symbiosis/provider/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
)

Expand Down
26 changes: 13 additions & 13 deletions provider/cmd/pulumi-resource-symbiosis/schema.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions provider/cmd/pulumi-tfgen-symbiosis/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package main

import (
symbiosis "github.com/kuraudo-io/pulumi-symbiosis/provider"
"github.com/kuraudo-io/pulumi-symbiosis/provider/pkg/version"
symbiosis "github.com/symbiosis-cloud/pulumi-symbiosis/provider"
"github.com/symbiosis-cloud/pulumi-symbiosis/provider/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen"
)

Expand Down
2 changes: 1 addition & 1 deletion provider/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/kuraudo-io/pulumi-symbiosis/provider
module github.com/symbiosis-cloud/pulumi-symbiosis/provider

go 1.19

Expand Down
16 changes: 8 additions & 8 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"path/filepath"

"github.com/kuraudo-io/pulumi-symbiosis/provider/pkg/version"
"github.com/symbiosis-cloud/pulumi-symbiosis/provider/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
shimv2 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2"
Expand Down Expand Up @@ -61,7 +61,7 @@ func Provider() tfbridge.ProviderInfo {
// Change this to your personal name (or a company name) that you
// would like to be shown in the Pulumi Registry if this package is published
// there.
Publisher: "Kuraudo.io",
Publisher: "Symbiosis",

// LogoURL is optional but useful to help identify your package in the Pulumi Registry
// if this package is published there.
Expand All @@ -73,7 +73,7 @@ func Provider() tfbridge.ProviderInfo {
// PluginDownloadURL is an optional URL used to download the Provider
// for use in Pulumi programs
// e.g https://github.com/org/pulumi-provider-name/releases/
PluginDownloadURL: "github://api.github.com/kuraudo-io",
PluginDownloadURL: "github://api.github.com/symbiosis-cloud",

Description: "A Pulumi package for creating and managing symbiosis cloud resources.",

Expand All @@ -86,7 +86,7 @@ func Provider() tfbridge.ProviderInfo {

Homepage: "https://www.pulumi.com",

Repository: "https://github.com/kuraudo-io/pulumi-symbiosis",
Repository: "https://github.com/symbiosis-cloud/pulumi-symbiosis",

// The GitHub Org for the provider - defaults to `terraform-providers`. Note that this
// should match the TF provider module's require directive, not any replace directives.
Expand Down Expand Up @@ -127,20 +127,20 @@ func Provider() tfbridge.ProviderInfo {
"@types/node": "^10.0.0", // so we can access strongly typed node definitions.
"@types/mime": "^2.0.0",
},
PackageName: "@kuraudo-io/symbiosis",
PackageName: "@symbiosis-cloud/symbiosis-pulumi",
},

Python: &tfbridge.PythonInfo{
// List any Python dependencies and their version ranges
PackageName: "kuraudo_symbiosis",
PackageName: "symbiosis_pulumi",
Requires: map[string]string{
"pulumi": ">=3.0.0,<4.0.0",
},
},

Golang: &tfbridge.GolangInfo{
ImportBasePath: filepath.Join(
fmt.Sprintf("github.com/kuraudo-io/pulumi-%[1]s/sdk/", mainPkg),
fmt.Sprintf("github.com/symbiosis-cloud/pulumi-%[1]s/sdk/", mainPkg),
tfbridge.GetModuleMajorVersion(version.Version),
"go",
mainPkg,
Expand All @@ -149,7 +149,7 @@ func Provider() tfbridge.ProviderInfo {
},

CSharp: &tfbridge.CSharpInfo{
RootNamespace: "Kuraudo",
RootNamespace: "Symbiosis.Pulumi",
PackageReferences: map[string]string{
"Pulumi": "3.*",
},
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Collections.Immutable;

namespace Kuraudo.Symbiosis
namespace Symbiosis.Pulumi.Symbiosis
{
public static class Config
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Kuraudo.io</Authors>
<Company>Kuraudo.io</Company>
<Authors>Symbiosis</Authors>
<Company>Symbiosis</Company>
<Description>A Pulumi package for creating and managing symbiosis cloud resources.</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://www.pulumi.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/kuraudo-io/pulumi-symbiosis</RepositoryUrl>
<RepositoryUrl>https://github.com/symbiosis-cloud/pulumi-symbiosis</RepositoryUrl>
<PackageIcon>logo.png</PackageIcon>

<TargetFramework>netcoreapp3.1</TargetFramework>
Expand Down
6 changes: 3 additions & 3 deletions sdk/dotnet/Cluster.cs → sdk/dotnet/Symbiosis/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Pulumi.Serialization;
using Pulumi;

namespace Kuraudo.Symbiosis
namespace Symbiosis.Pulumi.Symbiosis
{
/// <summary>
/// Manages Kubernetes clusters.
Expand All @@ -18,7 +18,7 @@ namespace Kuraudo.Symbiosis
/// ```csharp
/// using System.Collections.Generic;
/// using Pulumi;
/// using Symbiosis = Kuraudo.Symbiosis;
/// using Symbiosis = Symbiosis.Pulumi.Symbiosis;
///
/// return await Deployment.RunAsync(() =&gt;
/// {
Expand Down Expand Up @@ -92,7 +92,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/kuraudo-io",
PluginDownloadURL = "github://api.github.com/symbiosis-cloud",
AdditionalSecretOutputs =
{
"caCertificate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Pulumi.Serialization;
using Pulumi;

namespace Kuraudo.Symbiosis
namespace Symbiosis.Pulumi.Symbiosis
{
/// <summary>
/// Manages Kubernetes clusters service accounts.
Expand All @@ -18,7 +18,7 @@ namespace Kuraudo.Symbiosis
/// ```csharp
/// using System.Collections.Generic;
/// using Pulumi;
/// using Symbiosis = Kuraudo.Symbiosis;
/// using Symbiosis = Symbiosis.Pulumi.Symbiosis;
///
/// return await Deployment.RunAsync(() =&gt;
/// {
Expand Down Expand Up @@ -74,7 +74,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/kuraudo-io",
PluginDownloadURL = "github://api.github.com/symbiosis-cloud",
AdditionalSecretOutputs =
{
"clusterCaCertificate",
Expand Down
Loading

0 comments on commit 79f96ec

Please sign in to comment.