app_template.go 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. package models
  2. import (
  3. "github.com/google/uuid"
  4. "gorm.io/gorm"
  5. )
  6. // AppTemplate represents a partial spec of a porter app that hydrates the first revision of an app
  7. type AppTemplate struct {
  8. gorm.Model
  9. // ID is a UUID for the AppRevision
  10. ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
  11. // Name is the name of the template, most commonly matches the app name and is unique within the project
  12. Name string `json:"name" gorm:"default:''"`
  13. // Base64App is the PorterApp as json encoded in base64
  14. Base64App string `json:"base64_app"`
  15. // ProjectID is the ID of the project that the template belongs to.
  16. ProjectID int `json:"project_id"`
  17. // PorterAppID is the ID of the PorterApp that the template belongs to.
  18. PorterAppID int `json:"porter_app_id"`
  19. // BaseDeploymentTargetID is the ID of the deployment target that this template is based on
  20. // This is used to look up the latest app revision in the base, which will hydrate the template on apply.
  21. BaseDeploymentTargetID uuid.UUID `json:"base_deployment_target_id" gorm:"type:uuid;default:00000000-0000-0000-0000-000000000000"`
  22. // Base64AddonTemplates is an encoded object containing templated addons to deploy alongside the app
  23. Base64AddonTemplates string `json:"base64_addon_templates"`
  24. }