Add Docker Verify and Merge jobs
[releng/global-jjb.git] / docs / jjb / lf-docker-jobs.rst
1 ###########
2 Docker Jobs
3 ###########
4
5 Job Groups
6 ==========
7
8 .. include:: ../job-groups.rst
9
10 Below is a list of Docker job groups:
11
12 .. literalinclude:: ../../jjb/lf-docker-job-groups.yaml
13    :language: yaml
14
15
16 Macros
17 ======
18
19 lf-docker-get-container-tag
20 ---------------------------
21
22 Calls docker-get-git-describe.sh or docker-get-yaml-tag.sh (depending on the
23 'docker-use-params-from' condition) to obtain the tag to build.
24
25 lf-docker-build
26 ---------------
27
28 Calls docker build to build the container.
29
30 lf-docker-push
31 --------------
32
33 Calls docker-push.sh script to push docker images.
34
35 Job Templates
36 =============
37
38 Docker Verify
39 -------------
40
41 Executes a docker build task.
42
43 :Template Names:
44
45     - {project-name}-docker-verify-{stream}
46     - gerrit-docker-verify
47     - github-docker-verify
48
49 :Comment Trigger: recheck|reverify
50
51 :Required parameters:
52
53     :build-node: The node to run build on.
54     :container-public-registry: Docker registry source with base images.
55     :docker-name: Name of the Docker image.
56     :docker-use-params-from: Used to select the source of the tag information.
57         Options are "git-describe-params" or "yaml-file-params". (yaml-file-params
58         expects the tag to be defined in a local file "container-tag.yaml").
59     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
60         be configured in defaults.yaml)
61     :mvn-settings: Maven settings.xml file containing credentials to use.
62
63 :Optional parameters:
64
65     :branch: Git branch to fetch for the build. (default: master)
66     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
67     :build-timeout: Timeout in minutes before aborting build. (default: 60)
68     :docker-build-args: Additional arguments for the docker build command.
69     :docker-root: Path of the Dockerfile within the repo.
70     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
71     :pre_docker_build_script: Optional build script to execute before the main verify
72         builder steps.
73     :post_docker_build_script: Optional build script to execute after the main verify
74         builder steps.
75     :stream: Keyword that can be used to represent a release code-name.
76         Often the same as the branch. (default: master)
77     :submodule-recursive: Whether to checkout submodules recursively.
78         (default: true)
79     :submodule-timeout: Timeout (in minutes) for checkout operation.
80         (default: 10)
81
82     :gerrit_verify_triggers: Override Gerrit Triggers.
83     :gerrit_trigger_file_paths: Override file paths which can be used to
84         filter which file modifications will trigger a build.
85
86 container-tag.yaml example:
87
88 .. code-block:: yaml
89
90    ---
91    tag: 1.0.0
92
93 Docker Merge
94 ------------
95
96 Executes a docker build task and publishes the resulting images to a specified Docker registry.
97
98 :Template Names:
99
100     - {project-name}-docker-merge-{stream}
101     - gerrit-docker-merge
102     - github-docker-merge
103
104 :Comment Trigger: remerge
105
106 :Required parameters:
107
108     :build-node: The node to run build on.
109     :container-public-registry: Docker registry source with base images.
110     :container-push-registry: Docker registry target for the deploy action.
111     :docker-name: Name of the Docker image.
112     :docker-use-params-from: Used to select the source of the tag information.
113         Options are "git-describe-params" or "yaml-file-params". (yaml-file-params
114         expects the tag to be defined in a local file "container-tag.yaml").
115     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
116         be configured in defaults.yaml)
117     :mvn-settings: Maven settings.xml file containing credentials to use.
118
119 :Optional parameters:
120
121     :branch: Git branch to fetch for the build. (default: master)
122     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
123     :build-timeout: Timeout in minutes before aborting build. (default: 60)
124     :docker-build-args: Additional arguments for the docker build command.
125     :docker-root: Path of the Dockerfile within the repo.
126     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
127     :pre_docker_build_script: Optional build script to execute before the main merge
128         builder steps.
129     :post_docker_build_script: Optional build script to execute after the main merge
130         builder steps.
131     :stream: Keyword that can be used to represent a release code-name.
132         Often the same as the branch. (default: master)
133     :submodule-recursive: Whether to checkout submodules recursively.
134         (default: true)
135     :submodule-timeout: Timeout (in minutes) for checkout operation.
136         (default: 10)
137
138     :gerrit_verify_triggers: Override Gerrit Triggers.
139     :gerrit_trigger_file_paths: Override file paths which can be used to
140         filter which file modifications will trigger a build.
141
142 container-tag.yaml example:
143
144 .. code-block:: yaml
145
146    ---
147    tag: 1.0.0