Skip to content

Commit

Permalink
Make sourceContext optional
Browse files Browse the repository at this point in the history
  • Loading branch information
komalali committed Oct 11, 2024
1 parent b5b3c56 commit 8ae091d
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 51 deletions.
37 changes: 37 additions & 0 deletions examples/examples_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,43 @@ func TestYamlDeploymentSettingsExample(t *testing.T) {
})
}

func TestYamlDeploymentSettingsNoSourceExample(t *testing.T) {

// Set up tmpdir with a Pulumi.yml with no resources
// mimicking the deletion of resource
newProgram := YamlProgram{
Name: "yaml-deployment-settings-example-no-source",
Runtime: "yaml",
}

tmpdir := writePulumiYaml(t, newProgram)

cwd, _ := os.Getwd()
digits := generateRandomFiveDigits()

integration.ProgramTest(t, &integration.ProgramTestOptions{
Quick: true,
Dir: path.Join(cwd, ".", "yaml-deployment-settings-no-source"),
StackName: "test-stack-" + digits,
Config: map[string]string{
"digits": digits,
},
PrepareProject: func(_ *engine.Projinfo) error {
return nil
},
EditDirs: []integration.EditDir{
{
Dir: tmpdir,
},
// Reapply the same thing again, except this time we expect there to be no changes
{
Dir: tmpdir,
ExpectNoChanges: true,
},
},
})
}

func TestYamlTeamAccessTokenExample(t *testing.T) {
cwd, _ := os.Getwd()
integration.ProgramTest(t, &integration.ProgramTestOptions{
Expand Down
16 changes: 16 additions & 0 deletions examples/yaml-deployment-settings-no-source/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: yaml-deployment-settings-example
runtime: yaml
description: Deployment settings test
resources:
my_settings:
type: pulumiservice:DeploymentSettings
properties:
organization: service-provider-test-org
project: yaml-deployment-settings-example
stack: test-stack-${digits}
operationContext:
preRunCommands:
- yarn
- ls -al
environmentVariables:
TEST_VAR: "test-value"
Empty file.
Empty file.
8 changes: 3 additions & 5 deletions provider/cmd/pulumi-resource-pulumiservice/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@
"value": "admin"
}
]
},
},
"pulumiservice:index:TemplateSourceDestination": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1070,8 +1070,7 @@
"required": [
"organization",
"project",
"stack",
"sourceContext"
"stack"
],
"inputProperties": {
"organization": {
Expand Down Expand Up @@ -1110,8 +1109,7 @@
"requiredInputs": [
"organization",
"project",
"stack",
"sourceContext"
"stack"
]
},
"pulumiservice:index:StackTag": {
Expand Down
6 changes: 3 additions & 3 deletions sdk/dotnet/DeploymentSettings.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions sdk/go/pulumiservice/deploymentSettings.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 87 additions & 0 deletions sdk/go/pulumiservice/pulumiTypes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions sdk/nodejs/deploymentSettings.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8ae091d

Please sign in to comment.