forked from GoogleCloudPlatform/terraformer
-
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.
Merge pull request GoogleCloudPlatform#403 from rgreinho/octopus-prov…
…ider Add OctopusDeploy provider
- Loading branch information
Showing
20 changed files
with
621 additions
and
0 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 |
---|---|---|
|
@@ -4,3 +4,5 @@ terraformer | |
.DS_Store | ||
.terraform | ||
.vscode | ||
terraform.tfstate | ||
terraform.tfstate.backup |
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
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,36 @@ | ||
package cmd | ||
|
||
import ( | ||
octopusdeploy_terraforming "github.com/GoogleCloudPlatform/terraformer/providers/octopusdeploy" | ||
|
||
"github.com/GoogleCloudPlatform/terraformer/terraform_utils" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func newCmdOctopusDeployImporter(options ImportOptions) *cobra.Command { | ||
var server, apiKey string | ||
cmd := &cobra.Command{ | ||
Use: "octopusdeploy", | ||
Short: "Import current state to Terraform configuration from Octopus Deploy", | ||
Long: "Import current state to Terraform configuration from Octopus Deploy", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
provider := newOctopusDeployProvider() | ||
options.PathPattern = "{output}/{provider}/" | ||
err := Import(provider, options, []string{server, apiKey}) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
}, | ||
} | ||
|
||
cmd.AddCommand(listCmd(newOctopusDeployProvider())) | ||
baseProviderFlags(cmd.PersistentFlags(), &options, "octopusdeploy", "tagset") | ||
cmd.PersistentFlags().StringVar(&server, "server", "", "Octopus Server's API endpoint or env param OCTOPUS_CLI_SERVER") | ||
cmd.PersistentFlags().StringVar(&apiKey, "apikey", "", "Octopus API key or env param OCTOPUS_CLI_API_KEY") | ||
return cmd | ||
} | ||
|
||
func newOctopusDeployProvider() terraform_utils.ProviderGenerator { | ||
return &octopusdeploy_terraforming.OctopusDeployProvider{} | ||
} |
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
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
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
Oops, something went wrong.