Use credentials for openci job
[releng.git] / jjb / openci / openci-opnfv-daily-jobs.yaml
1 ---
2 - project:
3     name: openci-opnfv
4
5     project: '{name}'
6
7     stream:
8       - master:
9           branch: '{stream}'
10           gs-pathname: ''
11           disabled: false
12
13     scenario:
14       - 'os-odl-nofeature-ha':
15           origin: ODL
16       - 'k8-nosdn-onap-ha':
17           origin: ONAP
18
19     jobs:
20       - 'openci-opnfv-{scenario}-compose-daily-{stream}'
21       - 'openci-opnfv-{scenario}-test-daily-{stream}'
22
23 - job-template:
24     name: 'openci-opnfv-{scenario}-compose-daily-{stream}'
25
26     disabled: '{obj:disabled}'
27
28     concurrent: false
29
30     parameters:
31       - string:
32           name: PUBLISH_EVENT_TYPE
33           default: CompositionDefinedEvent
34           description: 'The type of the event this job publishes'
35       - string:
36           name: PUBLISH_EVENT_ORIGIN
37           default: OPNFV
38           description: 'Originating community'
39       - string:
40           name: DEPLOY_SCENARIO
41           default: '{scenario}'
42           description: 'The scenario that is composed'
43       - string:
44           name: SCENARIO_METADATA_LOCATION
45           default: https://url/to/scenario/metadata/on/opnfv/artifact/repo/$BUILD_NUMBER
46           description: 'The location of the scenario metadata'
47       - 'opnfv-build-defaults'
48
49     wrappers:
50       - credentials-binding:
51           - username-password-separated:
52               credential-id: openci-connect-activemq
53               username: ACTIVEMQ_USER
54               password: ACTIVEMQ_PASSWORD
55       - workspace-cleanup
56
57     triggers:
58       - jms-messaging:
59           provider-name: openci.activemq
60           selector: JMSType = 'ArtifactPublishedEvent' and JMSOrigin = 'ODL'
61
62     builders:
63       - shell: |
64           #!/bin/bash
65
66           echo
67           echo "Triggered by $type"
68           echo "----------------------------------"
69           echo $CI_MESSAGE
70           echo "----------------------------------"
71       - shell:
72           !include-raw-escape: ./create-cde.sh
73       - inject:
74           properties-file: "$WORKSPACE/event.properties"
75
76 - job-template:
77     name: 'openci-opnfv-{scenario}-test-daily-{stream}'
78
79     disabled: '{obj:disabled}'
80
81     concurrent: false
82
83     parameters:
84       - string:
85           name: PUBLISH_EVENT_TYPE
86           default: ConfidenceLevelModifiedEvent
87           description: 'The type of the event this job publishes'
88       - string:
89           name: PUBLISH_EVENT_ORIGIN
90           default: OPNFV
91           description: 'Originating community'
92       - string:
93           name: DEPLOY_SCENARIO
94           default: '{scenario}'
95           description: 'The scenario that is composed'
96       - string:
97           name: SCENARIO_METADATA_LOCATION
98           default: https://url/to/scenario/metadata/on/opnfv/artifact/repo/$BUILD_NUMBER
99           description: 'The location of the scenario metadata'
100       - string:
101           name: CONFIDENCE_LEVEL
102           default: "'opnfvdaily': 'SUCCESS'"
103           description: 'The confidence level the published artifact gained'
104       - 'opnfv-build-defaults'
105
106     triggers:
107       - jms-messaging:
108           provider-name: openci.activemq
109           selector: CI_TYPE = 'custom'
110           checks:
111             - field: origin
112               expected-value: 'OPNFV'
113             - field: type
114               expected-value: 'CompositionDefinedEvent'
115             - field: scenario
116               expected-value: '{scenario}'
117
118     builders:
119       - shell: |
120           #!/bin/bash
121
122           echo
123           echo "Triggered by $type"
124           echo "----------------------------------"
125           echo $CI_MESSAGE
126           echo "----------------------------------"
127       - shell:
128           !include-raw-escape: ./create-clme.sh
129       - inject:
130           properties-file: "$WORKSPACE/event.properties"
131
132     publishers:
133       - jms-messaging:
134           provider-name: openci.activemq
135           msg-type: Custom
136           msg-props: |
137             type=$type
138             origin=$origin
139             scenario=$scenario
140           msg-content:
141             $eventBody