Optimize the jjb-deploy trigger regex
[releng/global-jjb.git] / docs / jjb / lf-c-cpp-jobs.rst
1 ##########
2 C/C++ Jobs
3 ##########
4
5 Job Templates
6 =============
7
8 CMake Stage
9 -----------
10
11 Stage job which runs cmake && make && make install and then packages the
12 project into a tar.xz tarball to produce a release candidate.
13
14 :Template Names:
15
16     - {project-name}-cmake-stage-{stream}
17     - gerrit-cmake-stage
18     - github-cmake-stage
19
20 :Comment Trigger: stage-release
21
22 :Required parameters:
23
24     :build-node: The node to run build on.
25     :jenkins-ssh-credential: Credential to use for SSH.
26         (Configure in defaults.yaml)
27     :nexus-group-id: The Maven style Group ID for the namespace of the project
28         in Nexus.
29     :staging-profile-id: The unique Nexus Staging Profile ID for the project.
30         Contact your infra admin if you do not know it.
31
32 :Optional parameters:
33
34     :branch: Git branch to fetch for the build. (default: master)
35     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
36     :build-dir: Directory to build the project in. (default: $WORKSPACE/target)
37     :build-timeout: Timeout in minutes before aborting build. (default: 60)
38     :cmake-opts: Parameters to pass to cmake. (default: '')
39     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
40     :install-prefix: CMAKE_INSTALL_PREFIX to use for install.
41         (default: $BUILD_DIR/output)
42
43         .. code-block:: bash
44            :caption: Example
45
46            install-prefix: |
47                #!/bin/bash
48                echo "Hello World."
49
50     :make-opts: Parameters to pass to make. (default: '')
51     :pre-build: Shell script to run before performing build. Useful for
52         setting up dependencies. (default: '')
53     :stream: Keyword that to represent a release code-name.
54         Often the same as the branch. (default: master)
55     :submodule-recursive: Whether to checkout submodules recursively.
56         (default: true)
57     :submodule-timeout: Timeout (in minutes) for checkout operation.
58         (default: 10)
59     :version: (default: '') Project version to stage release as. There are 2
60         methods for using this value:
61
62         1) Defined explicitly here.
63         2) Leave this value blank and set /tmp/artifact_version
64
65         Use method 2 in conjunction with 'pre-build' configuration to
66         generate the artifact_version automatically from files in the
67         project's repository. For example with pre-build script:
68
69         .. code-block:: bash
70
71            #!/bin/bash
72            MAJOR_VERSION="$(grep 'set(OCIO_VERSION_MAJOR' CMakeLists.txt | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
73            MINOR_VERSION="$(grep 'set(OCIO_VERSION_MINOR' CMakeLists.txt | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
74            PATCH_VERSION="$(grep 'set(OCIO_VERSION_PATCH' CMakeLists.txt | awk '{{print $NF}}' | awk -F')' '{{print $1}}')"
75            echo "${{MAJOR_VERSION}}.${{MINOR_VERSION}}.${{PATCH_VERSION}}" > /tmp/artifact_version
76
77 CMake Verify
78 ------------
79
80 Verify job which runs cmake && make && make install to test a project build..
81
82 :Template Names:
83
84     - {project-name}-cmake-verify-{stream}
85     - gerrit-cmake-verify
86     - github-cmake-verify
87
88 :Comment Trigger: recheck|reverify
89
90 :Required parameters:
91
92     :build-node: The node to run build on.
93     :jenkins-ssh-credential: Credential to use for SSH.
94         (Configure in defaults.yaml)
95
96 :Optional parameters:
97
98     :branch: Git branch to fetch for the build. (default: master)
99     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
100     :build-dir: Directory to build the project in. (default: $WORKSPACE/target)
101     :build-timeout: Timeout in minutes before aborting build. (default: 60)
102     :cmake-opts: Parameters to pass to cmake. (default: '')
103     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
104     :install-prefix: CMAKE_INSTALL_PREFIX to use for install.
105         (default: $BUILD_DIR/output)
106
107         .. code-block:: bash
108            :caption: Example
109
110            install-prefix: |
111                #!/bin/bash
112                echo "Hello World."
113
114     :make-opts: Parameters to pass to make. (default: '')
115     :pre-build: Shell script to run before performing build. Useful for
116         setting up dependencies. (default: '')
117     :stream: Keyword that to represent a release code-name.
118         Often the same as the branch. (default: master)
119     :submodule-recursive: Whether to checkout submodules recursively.
120         (default: true)
121     :submodule-timeout: Timeout (in minutes) for checkout operation.
122         (default: 10)
123
124     :gerrit_verify_triggers: Override Gerrit Triggers.
125     :gerrit_trigger_file_paths: Override file paths which to filter which file
126         modifications will trigger a build.