2
0

utils.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. // If set to true, this does not run an update, it only creates the initial application and job,
  59. // skipping subsequent updates
  60. OnlyCreate bool
  61. Build struct {
  62. UseCache bool `mapstructure:"use_cache"`
  63. Method string
  64. Context string
  65. Dockerfile string
  66. Image string
  67. Builder string
  68. Buildpacks []string
  69. Env map[string]string
  70. }
  71. EnvGroups []types.EnvGroupMeta `mapstructure:"env_groups"`
  72. Values map[string]interface{}
  73. }