airflow.contrib.operators.gcp_cloud_build_operator

Operators that integrat with Google Cloud Build service.

Module Contents

airflow.contrib.operators.gcp_cloud_build_operator.REGEX_REPO_PATH[source]
class airflow.contrib.operators.gcp_cloud_build_operator.BuildProcessor(body)[source]

Processes build configurations to add additional functionality to support the use of operators.

The following improvements are made:

  • It is required to provide the source and only one type can be given,

  • It is possible to provide the source as the URL address instead dict.

Parameters

body (dict) – The request body. See: https://cloud.google.com/cloud-build/docs/api/reference/rest/Shared.Types/Build

_verify_source(self)[source]
_reformat_source(self)[source]
_reformat_repo_source(self)[source]
_reformat_storage_source(self)[source]
process_body(self)[source]

Processes the body passed in the constructor

Returns

the body.

Type

dict

static _convert_repo_url_to_dict(source)[source]

Convert url to repository in Google Cloud Source to a format supported by the API

Example valid input:

https://source.developers.google.com/p/airflow-project/r/airflow-repo#branch-name
static _convert_storage_url_to_dict(storage_url)[source]

Convert url to object in Google Cloud Storage to a format supported by the API

Example valid input:

gs://bucket-name/object-name.tar.gz
class airflow.contrib.operators.gcp_cloud_build_operator.CloudBuildCreateBuildOperator(body, project_id=None, gcp_conn_id='google_cloud_default', api_version='v1', *args, **kwargs)[source]

Bases: airflow.models.BaseOperator

Starts a build with the specified configuration.

See also

For more information on how to use this operator, take a look at the guide: Trigger a build

Parameters
template_fields = ['body', 'gcp_conn_id', 'api_version'][source]
_validate_inputs(self)[source]
execute(self, context)[source]

Was this entry helpful?