Skip to content

Commit

Permalink
Merge ESC Projects feature branch (#405)
Browse files Browse the repository at this point in the history
Add ESC Projects (#398)
  • Loading branch information
seanyeh authored Sep 10, 2024
1 parent 45b952e commit b8f525f
Show file tree
Hide file tree
Showing 55 changed files with 942 additions and 287 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Improvements

- Added support for ESC Projects [#401](https://github.com/pulumi/pulumi-pulumiservice/issues/401)

### Bug Fixes

### Miscellaneous
3 changes: 3 additions & 0 deletions examples/cs-environments/MyStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public MyStack()
"testing-environment",
new EnvironmentArgs {
Organization = "service-provider-test-org",
Project = "my-project",
Name = "testing-environment-cs-" + config.Require("digits"),
Yaml = new StringAsset(yaml)
}
Expand All @@ -29,6 +30,7 @@ public MyStack()
"StableTag",
new EnvironmentVersionTagArgs {
Organization = environment.Organization,
Project = environment.Project,
Environment = environment.Name,
TagName = "stable",
Revision = environment.Revision
Expand All @@ -40,6 +42,7 @@ public MyStack()
"VersionTag",
new EnvironmentVersionTagArgs {
Organization = environment.Organization,
Project = environment.Project,
Environment = environment.Name,
TagName = environment.Revision.Apply(rev => "v"+rev),
Revision = environment.Revision
Expand Down
3 changes: 3 additions & 0 deletions examples/go-environments/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func main() {

environment, err := pulumiservice.NewEnvironment(ctx, "testing-environment", &pulumiservice.EnvironmentArgs{
Name: pulumi.String("testing-environment-go-" + conf.Require("digits")),
Project: pulumi.String("my-project"),
Organization: pulumi.String("service-provider-test-org"),
Yaml: pulumi.NewStringAsset(yaml),
})
Expand All @@ -29,6 +30,7 @@ func main() {
// A tag that will always be placed on the latest revision of the environment
_, err = pulumiservice.NewEnvironmentVersionTag(ctx, "StableTag", &pulumiservice.EnvironmentVersionTagArgs{
Organization: environment.Organization,
Project: environment.Project,
Environment: environment.Name,
TagName: pulumi.String("stable"),
Revision: environment.Revision,
Expand All @@ -40,6 +42,7 @@ func main() {
// A tag that will be placed on each new version, and remain on old revisions
_, err = pulumiservice.NewEnvironmentVersionTag(ctx, "VersionTag", &pulumiservice.EnvironmentVersionTagArgs{
Organization: environment.Organization,
Project: environment.Project,
Environment: environment.Name,
TagName: environment.Revision.ApplyT(func(rev int) (string, error) {
return "v" + strconv.Itoa(rev), nil
Expand Down
3 changes: 3 additions & 0 deletions examples/py-environments/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
environment = Environment(
"testing-environment",
organization="service-provider-test-org",
project="my-project",
name="testing-environment-py-"+config.require('digits'),
yaml=pulumi.StringAsset("""values:
myKey1: "myValue1"
Expand All @@ -21,6 +22,7 @@
stableTag = EnvironmentVersionTag(
"StableTag",
organization=environment.organization,
project=environment.project,
environment=environment.name,
tag_name="stable",
revision=environment.revision,
Expand All @@ -30,6 +32,7 @@
versionTag = EnvironmentVersionTag(
"VersionTag",
organization=environment.organization,
project=environment.project,
environment=environment.name,
tag_name=environment.revision.apply(
lambda revision: "v" + str(revision)
Expand Down
1 change: 1 addition & 0 deletions examples/ts-environments-file-asset/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const config = new pulumi.Config();

const environment = new service.Environment("testing-environment", {
organization: "service-provider-test-org",
project: "my-project",
name: "testing-environment-ts-file-asset"+config.require("digits"),
yaml: new pulumi.asset.FileAsset("env.yaml")
})
3 changes: 3 additions & 0 deletions examples/ts-environments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ let config = new pulumi.Config();

var environment = new service.Environment("testing-environment", {
organization: "service-provider-test-org",
project: "my-project",
name: "testing-environment-ts-"+config.require("digits"),
yaml: new pulumi.asset.StringAsset(
`values:
Expand All @@ -19,6 +20,7 @@ var environment = new service.Environment("testing-environment", {
var stableTag = new service.EnvironmentVersionTag("StableTag", {
organization: environment.organization,
environment: environment.name,
project: environment.project,
tagName: "stable",
revision: environment.revision
})
Expand All @@ -27,6 +29,7 @@ var stableTag = new service.EnvironmentVersionTag("StableTag", {
var versionTag = new service.EnvironmentVersionTag("VersionTag", {
organization: environment.organization,
environment: environment.name,
project: environment.project,
tagName: environment.revision.apply((rev: number) => "v"+rev),
revision: environment.revision
}, {
Expand Down
3 changes: 3 additions & 0 deletions examples/yaml-environments/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
type: pulumiservice:Environment
properties:
organization: service-provider-test-org
project: my-project
name: testing-environment-yaml-${digits}
yaml:
fn::stringAsset: |-
Expand All @@ -18,13 +19,15 @@ resources:
type: pulumiservice:EnvironmentVersionTag
properties:
organization: ${testing-environment.organization}
project: ${testing-environment.project}
environment: ${testing-environment.name}
tagName: stable
revision: ${testing-environment.revision}
versionTag:
type: pulumiservice:EnvironmentVersionTag
properties:
organization: ${testing-environment.organization}
project: ${testing-environment.project}
environment: ${testing-environment.name}
tagName: v${testing-environment.revision}
revision: ${testing-environment.revision}
Expand Down
25 changes: 25 additions & 0 deletions provider/cmd/pulumi-resource-pulumiservice/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,10 @@
"description": "Environment name.",
"type": "string"
},
"project": {
"description": "Project name.",
"type": "string"
},
"yaml": {
"description": "Environment's yaml file.",
"$ref": "pulumi.json#/Asset"
Expand All @@ -1337,6 +1341,7 @@
},
"required": [
"organization",
"project",
"name",
"yaml",
"revision"
Expand All @@ -1346,6 +1351,11 @@
"description": "Organization name.",
"type": "string"
},
"project": {
"description": "Project name.",
"default": "default",
"type": "string"
},
"name": {
"description": "Environment name.",
"type": "string"
Expand Down Expand Up @@ -1378,6 +1388,11 @@
"description": "Team name.",
"type": "string"
},
"project": {
"description": "Project name.",
"default": "default",
"type": "string"
},
"environment": {
"description": "Environment name.",
"type": "string"
Expand All @@ -1401,6 +1416,10 @@
"description": "Organization name.",
"type": "string"
},
"project": {
"description": "Project name.",
"type": "string"
},
"environment": {
"description": "Environment name.",
"type": "string"
Expand All @@ -1416,6 +1435,7 @@
},
"required": [
"organization",
"project",
"environment",
"tagName",
"revision"
Expand All @@ -1425,6 +1445,11 @@
"description": "Organization name.",
"type": "string"
},
"project": {
"description": "Project name.",
"default": "default",
"type": "string"
},
"environment": {
"description": "Environment name.",
"type": "string"
Expand Down
32 changes: 16 additions & 16 deletions provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ module github.com/pulumi/pulumi-pulumiservice/provider
go 1.21.0

require (
github.com/pulumi/esc v0.9.1
github.com/pulumi/pulumi/pkg/v3 v3.112.0
github.com/pulumi/pulumi/sdk/v3 v3.115.3-0.20240507143413-cffdfd1fa489
github.com/pulumi/esc v0.9.2-0.20240910221656-328d3204100f
github.com/pulumi/pulumi/pkg/v3 v3.131.0
github.com/pulumi/pulumi/sdk/v3 v3.131.0
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
Expand Down Expand Up @@ -49,7 +50,7 @@ require (
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
Expand All @@ -69,7 +70,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
github.com/segmentio/asm v1.1.3 // indirect
Expand All @@ -79,21 +80,20 @@ require (
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/zclconf/go-cty v1.13.2 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/frand v1.4.2 // indirect
Expand Down
Loading

0 comments on commit b8f525f

Please sign in to comment.