#[non_exhaustive]pub struct BuildConfig {
pub name: String,
pub source_location: String,
pub function_target: String,
pub image_uri: String,
pub base_image: String,
pub enable_automatic_updates: bool,
pub worker_pool: String,
pub environment_variables: HashMap<String, String>,
pub service_account: String,
/* private fields */
}Expand description
Describes the Build step of the function that builds a container from the given source.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringOutput only. The Cloud Build name of the latest successful deployment of the function.
source_location: StringThe Cloud Storage bucket URI where the function source code is located.
function_target: StringOptional. The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named “function”.
image_uri: StringOptional. Artifact Registry URI to store the built image.
base_image: StringOptional. The base image used to build the function.
enable_automatic_updates: boolOptional. Sets whether the function will receive automatic base image updates.
worker_pool: StringOptional. Name of the Cloud Build Custom Worker Pool that should be used to
build the Cloud Run function. The format of this field is
projects/{project}/locations/{region}/workerPools/{workerPool} where
{project} and {region} are the project id and region respectively where
the worker pool is defined and {workerPool} is the short name of the
worker pool.
environment_variables: HashMap<String, String>Optional. User-provided build-time environment variables for the function
service_account: StringOptional. Service account to be used for building the container. The format
of this field is
projects/{projectId}/serviceAccounts/{serviceAccountEmail}.
Implementations§
Source§impl BuildConfig
impl BuildConfig
pub fn new() -> Self
Sourcepub fn set_source_location<T: Into<String>>(self, v: T) -> Self
pub fn set_source_location<T: Into<String>>(self, v: T) -> Self
Sets the value of source_location.
§Example
let x = BuildConfig::new().set_source_location("example");Sourcepub fn set_function_target<T: Into<String>>(self, v: T) -> Self
pub fn set_function_target<T: Into<String>>(self, v: T) -> Self
Sets the value of function_target.
§Example
let x = BuildConfig::new().set_function_target("example");Sourcepub fn set_image_uri<T: Into<String>>(self, v: T) -> Self
pub fn set_image_uri<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_base_image<T: Into<String>>(self, v: T) -> Self
pub fn set_base_image<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_enable_automatic_updates<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_automatic_updates<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_automatic_updates.
§Example
let x = BuildConfig::new().set_enable_automatic_updates(true);Sourcepub fn set_worker_pool<T: Into<String>>(self, v: T) -> Self
pub fn set_worker_pool<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_environment_variables<T, K, V>(self, v: T) -> Self
pub fn set_environment_variables<T, K, V>(self, v: T) -> Self
Sets the value of environment_variables.
§Example
let x = BuildConfig::new().set_environment_variables([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_service_account<T: Into<String>>(self, v: T) -> Self
pub fn set_service_account<T: Into<String>>(self, v: T) -> Self
Sets the value of service_account.
§Example
let x = BuildConfig::new().set_service_account("example");Trait Implementations§
Source§impl Clone for BuildConfig
impl Clone for BuildConfig
Source§fn clone(&self) -> BuildConfig
fn clone(&self) -> BuildConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more