-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
194 additions
and
22,014 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
schema.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2016-2020, Pulumi Corporation. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"errors" | ||
"io/fs" | ||
"io/ioutil" | ||
"log" | ||
"os" | ||
|
||
"github.com/pulumi/pulumi/pkg/v3/codegen/schema" | ||
) | ||
|
||
func main() { | ||
version, found := os.LookupEnv("VERSION") | ||
if !found { | ||
log.Fatal("version not found") | ||
} | ||
|
||
schemaContents, err := ioutil.ReadFile("./schema.json") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
var packageSpec schema.PackageSpec | ||
err = json.Unmarshal(schemaContents, &packageSpec) | ||
if err != nil { | ||
log.Fatalf("cannot deserialize schema: %v", err) | ||
} | ||
|
||
packageSpec.Version = version | ||
versionedContents, err := json.Marshal(packageSpec) | ||
if err != nil { | ||
log.Fatalf("cannot reserialize schema: %v", err) | ||
} | ||
|
||
// Clean up schema.go as it may be present & gitignored and tolerate an error if the file isn't present. | ||
err = os.Remove("./schema.go") | ||
if err != nil && !errors.Is(err, fs.ErrNotExist) { | ||
log.Fatal(err) | ||
} | ||
|
||
err = ioutil.WriteFile("./schema-embed.json", versionedContents, 0600) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2016-2018, Pulumi Corporation. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:generate go run ./generate.go | ||
|
||
package main | ||
|
||
import ( | ||
_ "embed" | ||
|
||
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge" | ||
outscale "github.com/outscale/pulumi-outscale/provider" | ||
"github.com/outscale/pulumi-outscale/provider/pkg/version" | ||
) | ||
|
||
//go:embed schema-embed.json | ||
var pulumiSchema []byte | ||
|
||
func main() { | ||
// Modify the path to point to the new provider | ||
tfbridge.Main("outscale", version.Version, outscale.Provider(), pulumiSchema) | ||
} |
1 change: 1 addition & 0 deletions
1
provider/cmd/pulumi-resource-outscale/pulumi-resource-xyz/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
schema.go |
63 changes: 63 additions & 0 deletions
63
provider/cmd/pulumi-resource-outscale/pulumi-resource-xyz/generate.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2016-2020, Pulumi Corporation. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"errors" | ||
"io/fs" | ||
"io/ioutil" | ||
"log" | ||
"os" | ||
|
||
"github.com/pulumi/pulumi/pkg/v3/codegen/schema" | ||
) | ||
|
||
func main() { | ||
version, found := os.LookupEnv("VERSION") | ||
if !found { | ||
log.Fatal("version not found") | ||
} | ||
|
||
schemaContents, err := ioutil.ReadFile("./schema.json") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
var packageSpec schema.PackageSpec | ||
err = json.Unmarshal(schemaContents, &packageSpec) | ||
if err != nil { | ||
log.Fatalf("cannot deserialize schema: %v", err) | ||
} | ||
|
||
packageSpec.Version = version | ||
versionedContents, err := json.Marshal(packageSpec) | ||
if err != nil { | ||
log.Fatalf("cannot reserialize schema: %v", err) | ||
} | ||
|
||
// Clean up schema.go as it may be present & gitignored and tolerate an error if the file isn't present. | ||
err = os.Remove("./schema.go") | ||
if err != nil && !errors.Is(err, fs.ErrNotExist) { | ||
log.Fatal(err) | ||
} | ||
|
||
err = ioutil.WriteFile("./schema-embed.json", versionedContents, 0600) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
provider/cmd/pulumi-resource-outscale/pulumi-resource-xyz/main.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2016-2018, Pulumi Corporation. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:generate go run ./generate.go | ||
|
||
package main | ||
|
||
import ( | ||
_ "embed" | ||
|
||
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge" | ||
outscale "github.com/outscale/pulumi-outscale/provider" | ||
"github.com/outscale/pulumi-outscale/provider/pkg/version" | ||
) | ||
|
||
//go:embed schema-embed.json | ||
var pulumiSchema []byte | ||
|
||
func main() { | ||
// Modify the path to point to the new provider | ||
tfbridge.Main("outscale", version.Version, outscale.Provider(), pulumiSchema) | ||
} |
Oops, something went wrong.