b661f527a8a48856463b0aeaa483cda5250899e3
[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 Gerrit file paths which can be
84         used to filter which file modifications will trigger a build.
85     :github_included_regions: Override Github file paths which can be
86         used to filter which file modifications will trigger a build;
87         must match parameter gerrit_trigger_file_paths
88
89
90 container-tag.yaml example:
91
92 .. code-block:: yaml
93
94    ---
95    tag: 1.0.0
96
97 Docker Merge
98 ------------
99
100 Executes a docker build task and publishes the resulting images to a specified Docker registry.
101
102 :Template Names:
103
104     - {project-name}-docker-merge-{stream}
105     - gerrit-docker-merge
106     - github-docker-merge
107
108 :Comment Trigger: remerge
109
110 :Required parameters:
111
112     :build-node: The node to run build on.
113     :container-public-registry: Docker registry source with base images.
114     :container-push-registry: Docker registry target for the deploy action.
115     :docker-name: Name of the Docker image.
116     :docker-use-params-from: Used to select the source of the tag information.
117         Options are "git-describe-params" or "yaml-file-params". (yaml-file-params
118         expects the tag to be defined in a local file "container-tag.yaml").
119     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
120         be configured in defaults.yaml)
121     :mvn-settings: Maven settings.xml file containing credentials to use.
122
123 :Optional parameters:
124
125     :branch: Git branch to fetch for the build. (default: master)
126     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
127     :build-timeout: Timeout in minutes before aborting build. (default: 60)
128     :cron: Cron schedule when to trigger the job. This parameter also
129         supports multiline input via YAML pipe | character in cases where
130         one may want to provide more than 1 cron timer. No default. Use
131         '@daily' to run daily or 'H H * * 0' to run weekly.
132     :docker-build-args: Additional arguments for the docker build command.
133     :docker-root: Path of the Dockerfile within the repo.
134     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
135     :pre_docker_build_script: Optional build script to execute before the main merge
136         builder steps.
137     :post_docker_build_script: Optional build script to execute after the main merge
138         builder steps.
139     :stream: Keyword that can be used to represent a release code-name.
140         Often the same as the branch. (default: master)
141     :submodule-recursive: Whether to checkout submodules recursively.
142         (default: true)
143     :submodule-timeout: Timeout (in minutes) for checkout operation.
144         (default: 10)
145
146     :gerrit_merge_triggers: Override Gerrit Triggers.
147     :gerrit_trigger_file_paths: Override Gerrit file paths which can be
148         used to filter which file modifications will trigger a build.
149     :github_included_regions: Override Github file paths which can be
150         used to filter which file modifications will trigger a build;
151         must match parameter gerrit_trigger_file_paths
152
153 container-tag.yaml example:
154
155 .. code-block:: yaml
156
157    ---
158    tag: 1.0.0