generated from pulumi/pulumi-tf-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows to Unix line ending conversion
- Loading branch information
Showing
3 changed files
with
128 additions
and
128 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 |
---|---|---|
@@ -1,63 +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) | ||
} | ||
} | ||
// 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 |
---|---|---|
@@ -1,39 +1,39 @@ | ||
// 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" | ||
"os" | ||
|
||
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge" | ||
acme "github.com/pulumiverse/pulumi-acme/provider" | ||
"github.com/pulumiverse/pulumi-acme/provider/pkg/version" | ||
"github.com/vancluever/terraform-provider-acme/v2/acme/dnsplugin" | ||
) | ||
|
||
//go:embed schema-embed.json | ||
var pulumiSchema []byte | ||
|
||
func main() { | ||
if len(os.Args) == 2 && os.Args[1] == dnsplugin.PluginArg { | ||
// Start the plugin here | ||
dnsplugin.Serve() | ||
} else { | ||
tfbridge.Main("acme", version.Version, acme.Provider(), pulumiSchema) | ||
} | ||
} | ||
// 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" | ||
"os" | ||
|
||
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge" | ||
acme "github.com/pulumiverse/pulumi-acme/provider" | ||
"github.com/pulumiverse/pulumi-acme/provider/pkg/version" | ||
"github.com/vancluever/terraform-provider-acme/v2/acme/dnsplugin" | ||
) | ||
|
||
//go:embed schema-embed.json | ||
var pulumiSchema []byte | ||
|
||
func main() { | ||
if len(os.Args) == 2 && os.Args[1] == dnsplugin.PluginArg { | ||
// Start the plugin here | ||
dnsplugin.Serve() | ||
} else { | ||
tfbridge.Main("acme", version.Version, acme.Provider(), pulumiSchema) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
// 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. | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen" | ||
acme "github.com/pulumiverse/pulumi-acme/provider" | ||
"github.com/pulumiverse/pulumi-acme/provider/pkg/version" | ||
) | ||
|
||
func main() { | ||
// Modify the path to point to the new provider | ||
tfgen.Main("acme", version.Version, acme.Provider()) | ||
} | ||
// 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. | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen" | ||
acme "github.com/pulumiverse/pulumi-acme/provider" | ||
"github.com/pulumiverse/pulumi-acme/provider/pkg/version" | ||
) | ||
|
||
func main() { | ||
// Modify the path to point to the new provider | ||
tfgen.Main("acme", version.Version, acme.Provider()) | ||
} |