Merge "Update and simplify C jobs"
[ci-management.git] / jjb / global-templates-c.yaml
1 ---
2 ####################
3 # COMMON FUNCTIONS #
4 ####################
5
6 - c_job_common: &c_job_common
7     name: c-job-common
8
9     ######################
10     # Default parameters #
11     ######################
12
13     branch: master
14     submodule-recursive: true
15     submodule-timeout: 10
16
17     #####################
18     # Job Configuration #
19     #####################
20
21     project-type: freestyle
22     node: '{build-node}'
23     disabled: false
24
25     properties:
26       - infra-properties:
27           build-days-to-keep: '{build-days-to-keep}'
28
29     parameters:
30       - lf-infra-parameters:
31           project: '{project}'
32           branch: '{branch}'
33           stream: '{stream}'
34
35     scm:
36       - lf-infra-gerrit-scm:
37           jenkins-ssh-credential: '{jenkins-ssh-credential}'
38           git-url: '$GIT_URL/$PROJECT'
39           refspec: '$GERRIT_REFSPEC'
40           branch: '$GERRIT_BRANCH'
41           submodule-recursive: '{submodule-recursive}'
42           submodule-timeout: '{submodule-timeout}'
43           choosing-strategy: default
44
45     wrappers:
46       - lf-infra-wrappers:
47           build-timeout: '{build-timeout}'
48           jenkins-ssh-credential: '{jenkins-ssh-credential}'
49
50     publishers:
51       - lf-infra-publish
52
53 #################
54 # JOB TEMPLATES #
55 #################
56
57 - job-template:
58     #
59     # job template for build C/C++ project
60     #
61     # Required Variables:
62     #   script:         build script to execute
63     #
64     name: '{project-name}-{stream}-verify-c'
65     id: gerrit-verify-c
66     <<: *c_job_common
67
68     triggers:
69       - gerrit-trigger-patch-submitted:
70           server: '{server-name}'
71           project: '{project}'
72           branch: '{branch}'
73           files: '**'
74
75     builders:
76       - lf-infra-pre-build
77       - shell: '{script}'
78
79 - job-template:
80     # Job template for building & pushing docker images
81     #
82     # The purpose of this job template is to run:
83     #  1. login to the docker registry
84     #  2. run a specified shell builder
85     #
86     name: '{project-name}-{stream}-docker-c-shell-daily'
87     id: gerrit-docker-c-shell-daily
88     <<: *c_job_common
89     node: 'ubuntu1604-docker-8c-8g'
90
91     triggers:
92       # 12 AM UTC
93       - timed: '@daily'
94       - gerrit-trigger-release-manually:
95           server: '{server-name}'
96           project: '{project}'
97           branch: '{branch}'
98
99     builders:
100       - lf-infra-pre-build
101       - provide-maven-settings:
102           global-settings-file: 'global-settings'
103           settings-file: '{mvn-settings}'
104       - docker-login
105       - shell: '{script}'