8 .. include:: ../job-groups.rst
10 Below is a list of Docker job groups:
12 .. literalinclude:: ../../jjb/lf-docker-job-groups.yaml
19 lf-docker-get-container-tag
20 ---------------------------
22 Chooses a tag to label the container image based on the
23 'container-tag-method' parameter using the global-jjb script
24 docker-get-container-tag.sh. Use one of the following methods:
26 If container-tag-method: latest, the literal string 'latest' is used.
28 If container-tag-method: git-describe, the tag is obtained using the
29 git describe command on the repository, which requires that the repository
30 has a git tag. For example, if the most recent tag is 'v0.48.1', this
31 method yields a string like 'v0.48.1' or 'v0.48.1-25-gaee2dcb'.
33 If container-tag-method: yaml-file, the tag is obtained from the YAML file
34 'container-tag.yaml' in the docker-root directory using the top-level entry
35 'tag'. Alternately specify the directory with the YAML file in parameter
36 'container-tag-yaml-dir'. An example file appears next.
38 Example container-tag.yaml file:
46 Optionally, teams can supply their own script to choose the docker
47 tag. Pass the shell script path in optional configuration parameter
48 'docker-get-container-tag-script' which by default is the path to
49 file docker-get-container-tag.sh. The script must create the file
50 'env_docker_inject.txt' in the workspace with a line that assigns a
51 value to shell variable DOCKER_IMAGE_TAG, as shown next.
53 Example env_docker_inject.txt file:
57 DOCKER_IMAGE_TAG=1.0.0
63 Calls docker build to build the container.
68 Calls docker-push.sh script to push docker images.
76 Executes a docker build task.
80 - {project-name}-docker-verify-{stream}
81 - gerrit-docker-verify
82 - github-docker-verify
84 :Comment Trigger: **recheck|reverify** post a comment with one of the
85 triggers to launch this job manually. Do not include any other
86 text or vote in the same comment.
90 :build-node: The node to run build on.
91 :container-public-registry: Docker registry source with base images.
92 :docker-name: Name of the Docker image.
93 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
94 be configured in defaults.yaml)
95 :mvn-settings: Maven settings.xml file containing credentials to use.
99 :branch: Git branch to fetch for the build. (default: master)
100 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
101 :build-timeout: Timeout in minutes before aborting build. (default: 60)
102 :container-tag-method: Specifies the docker tag-choosing method.
103 Options are "latest", "git-describe" or "yaml-file".
104 Option git-describe requires a git tag to exist in the repository.
105 Option yaml-file requires a file "container-tag.yaml" to exist in the repository.
107 :container-tag-yaml-dir: Directory with container-tag.yaml. (default: $DOCKER_ROOT)
108 :docker-build-args: Additional arguments for the docker build command.
109 :docker-get-container-tag-script: Path to script that chooses docker tag.
110 (default: ../shell/docker-get-container-tag.sh)
111 :docker-root: Build directory within the repo. (default: $WORKSPACE, the repo root)
112 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
113 :pre_docker_build_script: Build script to execute before the main verify
114 builder steps. (default: a string with only a comment)
115 :post_docker_build_script: Build script to execute after the main verify
116 builder steps. (default: a string with only a comment)
117 :stream: Keyword that can be used to represent a release code-name.
118 Often the same as the branch. (default: master)
119 :submodule-recursive: Whether to checkout submodules recursively.
121 :submodule-timeout: Timeout (in minutes) for checkout operation.
124 :gerrit_verify_triggers: Override Gerrit Triggers.
125 :gerrit_trigger_file_paths: Override Gerrit file paths which can be
126 used to filter which file modifications will trigger a build.
127 :github_included_regions: Override Github file paths which can be
128 used to filter which file modifications will trigger a build;
129 must match parameter gerrit_trigger_file_paths
132 container-tag.yaml example:
142 Executes a docker build task and publishes the resulting images to a specified Docker registry.
146 - {project-name}-docker-merge-{stream}
147 - gerrit-docker-merge
148 - github-docker-merge
150 :Comment Trigger: **remerge** post a comment with the trigger to launch
151 this job manually. Do not include any other text or vote in the
154 :Required parameters:
156 :build-node: The node to run build on.
157 :container-public-registry: Docker registry source with base images.
158 :container-push-registry: Docker registry target for the deploy action.
159 :docker-name: Name of the Docker image.
160 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
161 be configured in defaults.yaml)
162 :mvn-settings: Maven settings.xml file containing credentials to use.
164 :Optional parameters:
166 :branch: Git branch to fetch for the build. (default: master)
167 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
168 :build-timeout: Timeout in minutes before aborting build. (default: 60)
169 :container-tag-method: Specifies the docker tag-choosing method.
170 Options are "latest", "git-describe" or "yaml-file".
171 Option git-describe requires a git tag to exist in the repository.
172 Option yaml-file requires a file "container-tag.yaml" to exist in the repository.
174 :container-tag-yaml-dir: Directory with container-tag.yaml. (default: $DOCKER_ROOT)
175 :cron: Cron schedule when to trigger the job. This parameter also
176 supports multiline input via YAML pipe | character in cases where
177 one may want to provide more than 1 cron timer. No default. Use
178 '@daily' to run daily or 'H H * * 0' to run weekly.
179 :docker-build-args: Additional arguments for the docker build command.
180 :docker-get-container-tag-script: Path to script that chooses docker tag.
181 (default: ../shell/docker-get-container-tag.sh)
182 :docker-root: Build directory within the repo. (default: $WORKSPACE, the repo root)
183 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
184 :pre_docker_build_script: Build script to execute before the main merge
185 builder steps. (default: a string with only a comment)
186 :post_docker_build_script: Build script to execute after the main merge
187 builder steps. (default: a string with only a comment)
188 :stream: Keyword that can be used to represent a release code-name.
189 Often the same as the branch. (default: master)
190 :submodule-recursive: Whether to checkout submodules recursively.
192 :submodule-timeout: Timeout (in minutes) for checkout operation.
195 :gerrit_merge_triggers: Override Gerrit Triggers.
196 :gerrit_trigger_file_paths: Override Gerrit file paths which can be
197 used to filter which file modifications will trigger a build.
198 :github_included_regions: Override Github file paths which can be
199 used to filter which file modifications will trigger a build;
200 must match parameter gerrit_trigger_file_paths
202 Sample container-tag.yaml File
203 ------------------------------