github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/hack/curl-pipeline-runner.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # Helper script for testing/developing the pipelinerunner controller.
     4  # In separate shell run: './build/jx controller pipelinerunner', then
     5  # execute this script to send an example payload.
     6  
     7  read -r -d '' JSON << EOJSON
     8  {
     9    "labels": {
    10      "created-by-prow": "true",
    11      "prowJobName": "cdf89f04-98ec-11e9-a846-4ad95a1bb3ab"
    12    },
    13    "prowJobSpec": {
    14      "type": "pullrequest",
    15      "agent": "tekton",
    16      "cluster": "default",
    17      "namespace": "jx",
    18      "job": "serverless-jenkins",
    19      "refs": {
    20        "org": "jenkins-x-quickstarts",
    21        "repo": "golang-http",
    22        "repo_link": "https://github.com/jenkins-x-quickstarts/golang-http",
    23        "base_ref": "master",
    24        "base_sha": "068a14d5fd69e8abda9aed69d132d5020e5f36d0",
    25        "pulls": [
    26          {
    27            "number": 1,
    28            "sha": "3f00363d651280ab2a8ee67f395de1689156d762"
    29          }
    30        ]
    31      },
    32      "report": true,
    33      "context": "serverless-jenkins",
    34      "rerun_command": "/test this"
    35    }
    36  }
    37  EOJSON
    38  
    39  curl -v http://localhost:8080 --data "$JSON" \
    40  --header "Host: pipelinerunner" \
    41  --header "Content-Type: application/json" \
    42  --header "Accept-Encoding: gzip"
    43  
    44  
    45  
    46  
    47