blob: 1f98f25c57c2098e2ac086d74313bfd0874aafd9 [file] [log] [blame]
:mod:`airflow.contrib.operators.gcp_cloud_build_operator`
=========================================================
.. py:module:: airflow.contrib.operators.gcp_cloud_build_operator
.. autoapi-nested-parse::
Operators that integrat with Google Cloud Build service.
Module Contents
---------------
.. data:: REGEX_REPO_PATH
.. py:class:: BuildProcessor(body)
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.
:param body: The request body.
See: https://cloud.google.com/cloud-build/docs/api/reference/rest/Shared.Types/Build
:type body: dict
.. method:: _verify_source(self)
.. method:: _reformat_source(self)
.. method:: _reformat_repo_source(self)
.. method:: _reformat_storage_source(self)
.. method:: process_body(self)
Processes the body passed in the constructor
:return: the body.
:type: dict
.. staticmethod:: _convert_repo_url_to_dict(source)
Convert url to repository in Google Cloud Source to a format supported by the API
Example valid input:
.. code-block:: none
https://source.developers.google.com/p/airflow-project/r/airflow-repo#branch-name
.. staticmethod:: _convert_storage_url_to_dict(storage_url)
Convert url to object in Google Cloud Storage to a format supported by the API
Example valid input:
.. code-block:: none
gs://bucket-name/object-name.tar.gz
.. py:class:: CloudBuildCreateBuildOperator(body, project_id=None, gcp_conn_id='google_cloud_default', api_version='v1', *args, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Starts a build with the specified configuration.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:CloudBuildCreateBuildOperator`
:param body: The request body.
See: https://cloud.google.com/cloud-build/docs/api/reference/rest/Shared.Types/Build
:type body: dict
:param gcp_conn_id: The connection ID to use to connect to Google Cloud Platform.
:type gcp_conn_id: str
:param api_version: API version used (for example v1 or v1beta1).
:type api_version: str
.. attribute:: template_fields
:annotation: = ['body', 'gcp_conn_id', 'api_version']
.. method:: _validate_inputs(self)
.. method:: execute(self, context)