2
0

utils.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. package preview
  2. import "github.com/porter-dev/porter/api/types"
  3. type Source struct {
  4. Name string
  5. Repo string
  6. Version string
  7. IsApplication bool
  8. SourceValues map[string]interface{}
  9. }
  10. type Target struct {
  11. AppName string `mapstructure:"app_name"`
  12. Project uint
  13. Cluster uint
  14. Namespace string
  15. RegistryURL string `mapstructure:"registry_url"`
  16. }
  17. type RandomStringDriverConfig struct {
  18. Length uint
  19. Lower bool
  20. }
  21. type EnvGroupDriverConfig struct {
  22. EnvGroups []*types.EnvGroup `mapstructure:"env_groups"`
  23. }
  24. type UpdateConfigDriverConfig struct {
  25. WaitForJob bool
  26. // If set to true, this does not run an update, it only creates the initial application and job,
  27. // skipping subsequent updates
  28. OnlyCreate bool
  29. UpdateConfig struct {
  30. Image string
  31. Tag string
  32. } `mapstructure:"update_config"`
  33. EnvGroups []types.EnvGroupMeta `mapstructure:"env_groups"`
  34. Values map[string]interface{}
  35. }
  36. type PushDriverConfig struct {
  37. Push struct {
  38. UsePackCache bool `mapstructure:"use_pack_cache"`
  39. Image string
  40. }
  41. }
  42. type BuildDriverConfig struct {
  43. Build struct {
  44. UsePackCache bool `mapstructure:"use_pack_cache"`
  45. Method string
  46. Context string
  47. Dockerfile string
  48. Builder string
  49. Buildpacks []string
  50. Image string
  51. Env map[string]string
  52. }
  53. EnvGroups []types.EnvGroupMeta `mapstructure:"env_groups"`
  54. Values map[string]interface{}
  55. }
  56. type ApplicationConfig struct {
  57. WaitForJob bool
  58. InjectBuild bool
  59. // If set to true, this does not run an update, it only creates the initial application and job,
  60. // skipping subsequent updates
  61. OnlyCreate bool
  62. Build struct {
  63. UseCache bool `mapstructure:"use_cache"`
  64. Method string
  65. Context string
  66. Dockerfile string
  67. Image string
  68. Builder string
  69. Buildpacks []string
  70. Env map[string]string
  71. }
  72. EnvGroups []types.EnvGroupMeta `mapstructure:"env_groups"`
  73. Values map[string]interface{}
  74. }