From f6025d6286214fbad08606c73fe622227abc2caf Mon Sep 17 00:00:00 2001 From: Nicholas Tate Date: Wed, 4 Nov 2020 15:21:43 -0800 Subject: [PATCH] apps: update spec to include image source --- apps.gen.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/apps.gen.go b/apps.gen.go index fe42fe40..e4f16554 100644 --- a/apps.gen.go +++ b/apps.gen.go @@ -83,6 +83,7 @@ type AppJobSpec struct { Name string `json:"name"` Git *GitSourceSpec `json:"git,omitempty"` GitHub *GitHubSourceSpec `json:"github,omitempty"` + Image *ImageSourceSpec `json:"image,omitempty"` // The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. DockerfilePath string `json:"dockerfile_path,omitempty"` // An optional build command to run while building this component from source. @@ -124,6 +125,7 @@ type AppServiceSpec struct { Name string `json:"name"` Git *GitSourceSpec `json:"git,omitempty"` GitHub *GitHubSourceSpec `json:"github,omitempty"` + Image *ImageSourceSpec `json:"image,omitempty"` // The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. DockerfilePath string `json:"dockerfile_path,omitempty"` // An optional build command to run while building this component from source. @@ -229,6 +231,7 @@ type AppWorkerSpec struct { Name string `json:"name"` Git *GitSourceSpec `json:"git,omitempty"` GitHub *GitHubSourceSpec `json:"github,omitempty"` + Image *ImageSourceSpec `json:"image,omitempty"` // The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. DockerfilePath string `json:"dockerfile_path,omitempty"` // An optional build command to run while building this component from source. @@ -334,6 +337,25 @@ type GitSourceSpec struct { Branch string `json:"branch,omitempty"` } +// ImageSourceSpec struct for ImageSourceSpec +type ImageSourceSpec struct { + RegistryType ImageSourceSpecRegistryType `json:"registry_type,omitempty"` + // The registry name. Must be left empty for the `DOCR` registry type. + Registry string `json:"registry,omitempty"` + // The repository name. + Repository string `json:"repository,omitempty"` + // The repository tag. Defaults to `latest` if not provided. + Tag string `json:"tag,omitempty"` +} + +// ImageSourceSpecRegistryType - DOCR: The DigitalOcean container registry type. +type ImageSourceSpecRegistryType string + +// List of ImageSourceSpecRegistryType +const ( + ImageSourceSpecRegistryType_DOCR ImageSourceSpecRegistryType = "DOCR" +) + // AppInstanceSize struct for AppInstanceSize type AppInstanceSize struct { Name string `json:"name,omitempty"`