github.com/munnerz/test-infra@v0.0.0-20190108210205-ce3d181dc989/prow/cmd/sub/README.md (about)

     1  # Sub
     2  
     3  Sub is a Prow Cloud Pub/Sub adapter for handling CI Pub/Sub notification requests.
     4  It currently supports Periodic Prow Job. Note that the prow job need to be defined in the configuration.
     5  
     6  ## Deployment Usage
     7  
     8  Sub supports 2 running modes, Push and Pull. Note that each subscription need to be one or the other, but Sub will run both.
     9  
    10  When deploy the sub component, you need to specify `--config-path` to your prow config, and optionally
    11  `--job-config-path` to your prowjob config if you have split them up.
    12  
    13  
    14  Options:
    15  * `--push-secret-file`: Path to Pub/Sub Push secret file.
    16  * `--dry-run`: Dry run for testing. Uses API tokens but does not mutate.
    17  * `--grace-period`: On shutdown, try to handle remaining events for the specified duration.
    18  
    19  ### Push Server
    20  
    21  In order to use the Push Mode, an HTTPs server needs to be setup and the URL must be defined in the Cloud Pub/Sub subscription.
    22  More information at https://cloud.google.com/pubsub/docs/quickstart-console.
    23  
    24  To secure even more requests from Cloud Pub/Syb, you can use `--push-secret-file` option.
    25  When using a push secret add the token to the URL like so  https://myapp.mydomain.com/myhandler?token=application-secret.
    26  More info at https://cloud.google.com/pubsub/docs/faq#security.
    27  
    28  ### Pull Server
    29  
    30  All pull subscriptions need to be defined in Prow Configuration:
    31  
    32  ```
    33  pubsub_subscriptions:
    34    "gcp-project-01":
    35    - "subscription-01"
    36    - "subscription-02"
    37    - "subscription-03"
    38    "gcp-project-02":
    39    - "subscription-01"
    40    - "subscription-02"
    41    - "subscription-03"
    42  ```
    43  
    44  Sub must be running with `GOOGLE_APPLICATION_CREDENTIALS` environment variable pointing to the service
    45  account credentials JSON file. The service account used must have the right permission on the
    46  subscriptions (`Pub/Sub Subscriber`, and `Pub/Sub Editor`).
    47  
    48  More information at https://cloud.google.com/pubsub/docs/access-control.
    49