Skip to content

Instantly share code, notes, and snippets.

@sochotnicky
Created February 22, 2019 12:39
Show Gist options
  • Select an option

  • Save sochotnicky/8a20a3a37a8031a2f44d8340110cd463 to your computer and use it in GitHub Desktop.

Select an option

Save sochotnicky/8a20a3a37a8031a2f44d8340110cd463 to your computer and use it in GitHub Desktop.
../jobs/sochotni-pipeline-throttle.yaml
- project:
name: sochotni-pipeline-throttle
jobs:
- "sochotni-pipeline-throttle":
- job-template:
name: "sochotni-pipeline-throttle"
project-type: pipeline
concurrent: true
properties:
- ownership:
owner: sochotni
- throttle:
max-total: 5
option: project
parameters:
- string:
name: CI_MESSAGE
description: "Make sure we deduplicate UMB messages: CID-3194"
description: |
Example pipeline using CI trigger, podTemplate and throttling
dsl: |
def label = "{name}"
timeout(time: 20, unit: 'MINUTES') {{
podTemplate(
name: '{name}',
label: label,
cloud: 'upshift',
idleMinutes: 1,
containers: [
containerTemplate(
name: 'jnlp',
image: 'docker-registry.engineering.redhat.com/devops-automation/rad-slave-ldap-group-sync:stage',
alwaysPullImage: true,
ttyEnabled: true,
// execute entrypoint from slave image
command: '',
args: '',
resourceRequestMemory: '256Mi',
resourceLimitMemory: '768Mi',
resourceRequestCpu: '100m',
resourceLimitCpu: '200m'
),
]
){{
node(label) {{
timestamps {{
stage('Show CI MESSAGE') {{
sh '''
echo $CI_MESSAGE
'''
}}
}}
}}
}}
}}
triggers:
- ci-trigger:
override-topic: Consumer.rh-jenkins-ci-plugin.b9ac67c4-8aa8-46b1-9c5d-4c923bde5979.VirtualTopic.eng.brew.task.closed.>
jms-selector: "method = 'buildContainer'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment