utils.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. }
  16. type RandomStringDriverConfig struct {
  17. Length uint
  18. Lower bool
  19. }
  20. type EnvGroupDriverConfig struct {
  21. EnvGroups []*types.EnvGroup `mapstructure:"env_groups"`
  22. }
  23. type UpdateConfigDriverConfig struct {
  24. WaitForJob bool
  25. // If set to true, this does not run an update, it only creates the initial application and job,
  26. // skipping subsequent updates
  27. OnlyCreate bool
  28. UpdateConfig struct {
  29. Image string
  30. Tag string
  31. } `mapstructure:"update_config"`
  32. EnvGroups []types.EnvGroupMeta `mapstructure:"env_groups"`
  33. Values map[string]interface{}
  34. }
  35. type PushDriverConfig struct {
  36. Push struct {
  37. UsePackCache bool `mapstructure:"use_pack_cache"`
  38. Image string
  39. }
  40. }
  41. type BuildDriverConfig struct {
  42. Build struct {
  43. UsePackCache bool `mapstructure:"use_pack_cache"`
  44. Method string
  45. Context string
  46. Dockerfile string
  47. Builder string
  48. Buildpacks []string
  49. Image string
  50. Env map[string]string
  51. }
  52. EnvGroups []types.EnvGroupMeta `mapstructure:"env_groups"`
  53. Values map[string]interface{}
  54. }
  55. type ApplicationConfig struct {
  56. WaitForJob bool
  57. // If set to true, this does not run an update, it only creates the initial application and job,
  58. // skipping subsequent updates
  59. OnlyCreate bool
  60. Build struct {
  61. UseCache bool `mapstructure:"use_cache"`
  62. Method string
  63. Context string
  64. Dockerfile string
  65. Image string
  66. Builder string
  67. Buildpacks []string
  68. Env map[string]string
  69. }
  70. EnvGroups []types.EnvGroupMeta `mapstructure:"env_groups"`
  71. Values map[string]interface{}
  72. }