We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To avoid code duplication, a helper function that sends a CloudEvent to Keptn would be nice.
For instance, this is the code that is duplicated right now:
def requestBody = """{ | "data": { | "project": "${project}", | "stage": "${stage}", | "service": "${service}", | "labels": { | "buildId" : "${tag}", | "jobname" : "${JOB_NAME}", | "buildNumber": "${BUILD_NUMBER}", | "joburl" : "${BUILD_URL}" | }, | "deployment": { | "deploymentstrategy": "direct", | "deploymentURIsPublic": [ | "${deploymentURI}" | ] | } | }, | "datacontenttype": "application/json", | "source": "jenkins-library", | "specversion": "1.0", | "type": "sh.keptn.event.deployment.finished", | "shkeptnspecversion": "${KEPTN_SPEC_VERSION}" |} """.stripMargin() // lets add our custom labels requestBody = addCustomLabels(requestBody, labels) def response = httpRequest contentType: 'APPLICATION_JSON', customHeaders: [[maskValue: true, name: 'x-token', value: "${keptn_api_token}"]], httpMode: 'POST', requestBody: requestBody, responseHandle: 'STRING', url: "${keptn_endpoint}/v1/event", validResponseCodes: "100:404", ignoreSslErrors: true // write response to keptn.context.json & add to artifacts def keptnContext = writeKeptnContextFiles(response)
project
service
stage
labels
specversion
shkeptnspecversion
source
datacontenttype
The text was updated successfully, but these errors were encountered:
No branches or pull requests
To avoid code duplication, a helper function that sends a CloudEvent to Keptn would be nice.
For instance, this is the code that is duplicated right now:
Optimizations
project
,service
,stage
,labels
,specversion
,shkeptnspecversion
,source
,datacontenttype
, ... could be moved into the helper functionThe text was updated successfully, but these errors were encountered: