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``, uses the literal string ``latest``.
28 If ``container-tag-method: git-describe``, reads the tag from 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``, reads the tag 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 to verify an test image build and discards the
77 test image upon completion.
81 - {project-name}-docker-verify-{stream}
82 - gerrit-docker-verify
83 - github-docker-verify
85 :Comment Trigger: **recheck|reverify** post a comment with one of the
86 triggers to launch this job manually. Do not include any other
87 text or vote in the same comment.
91 :build-node: The node to run build on.
92 :container-public-registry: Docker registry source with base images.
93 :docker-name: Name of the Docker image.
94 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
96 :mvn-settings: Maven settings.xml file containing Docker credentials.
100 :branch: Git branch to fetch for the build. (default: master)
101 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
102 :build-timeout: Timeout in minutes before aborting build. (default: 60)
103 :container-tag-method: Specifies the docker tag-choosing method.
104 Options are "latest", "git-describe" or "yaml-file".
105 Option latest uses the "latest" tag.
106 Option git-describe uses the string returned by git-describe,
107 which requires a tag to exist in the repository.
108 Option yaml-file uses the string from file "container-tag.yaml"
109 in the repository. (default: latest)
110 :container-tag-yaml-dir: Directory with container-tag.yaml. (default: $DOCKER_ROOT)
111 :docker-build-args: Arguments for the docker build command.
112 :docker-get-container-tag-script: Path to script that chooses docker tag.
113 (default: ../shell/docker-get-container-tag.sh in global-jjb)
114 :docker-root: Build directory within the repo. (default: $WORKSPACE, the repo root)
115 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
116 :pre_docker_build_script: Build script to execute before the main verify
117 builder steps. (default: "")
118 :post_docker_build_script: Build script to execute after the main verify
119 builder steps. (default: "")
120 :stream: Keyword that represents a release code-name.
121 Often the same as the branch. (default: master)
122 :submodule-recursive: Whether to checkout submodules recursively.
124 :submodule-timeout: Timeout (in minutes) for checkout operation.
127 :gerrit_verify_triggers: Override Gerrit Triggers.
128 :gerrit_trigger_file_paths: Override Gerrit file paths to filter which file
129 modifications will trigger a build.
130 :github_included_regions: Override Github file paths to filter which file
131 modifications will trigger a build; must match parameter
132 gerrit_trigger_file_paths
135 container-tag.yaml example:
145 Executes a docker build task and pushes the resulting image to the specified
146 Docker registry. If every image is a release candidate, this should use a
147 staging repository and occassionally run to check dependencies.
151 - {project-name}-docker-merge-{stream}
152 - gerrit-docker-merge
153 - github-docker-merge
155 :Comment Trigger: **remerge** post a comment with the trigger to launch
156 this job manually. Do not include any other text or vote in the
159 :Required parameters:
161 :build-node: The node to run build on.
162 :container-public-registry: Docker registry source with base images.
163 :container-push-registry: Docker registry target for the push action.
164 :docker-name: Name of the Docker image.
165 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
167 :mvn-settings: Maven settings.xml file containing Docker credentials.
169 :Optional parameters:
171 :branch: Git branch to fetch for the build. (default: master)
172 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
173 :build-timeout: Timeout in minutes before aborting build. (default: 60)
174 :container-tag-method: Specifies the docker tag-choosing method.
175 Options are "latest", "git-describe" or "yaml-file".
176 Option latest uses the "latest" tag.
177 Option git-describe uses the string returned by git-describe,
178 which requires a tag to exist in the repository.
179 Option yaml-file uses the string from file "container-tag.yaml"
180 in the repository. (default: latest)
181 :container-tag-yaml-dir: Directory with container-tag.yaml. (default: $DOCKER_ROOT)
182 :cron: Cron schedule when to trigger the job. This parameter also
183 supports multiline input via YAML pipe | character in cases where
184 one may want to provide more than 1 cron timer. Use '@daily' to run
185 daily or '@weekly' to run weekly. (default: @weekly)
186 :docker-build-args: Arguments for the docker build command.
187 :docker-get-container-tag-script: Path to script that chooses docker tag.
188 (default: ../shell/docker-get-container-tag.sh in global-jjb)
189 :docker-root: Build directory within the repo. (default: $WORKSPACE, the repo root)
190 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
191 :pre_docker_build_script: Build script to execute before the main merge
192 builder steps. (default: "")
193 :post_docker_build_script: Build script to execute after the main merge
194 builder steps. (default: "")
195 :stream: Keyword that represents a release code-name.
196 Often the same as the branch. (default: master)
197 :submodule-recursive: Whether to checkout submodules recursively.
199 :submodule-timeout: Timeout (in minutes) for checkout operation.
202 :gerrit_merge_triggers: Override Gerrit Triggers.
203 :gerrit_trigger_file_paths: Override Gerrit file paths to filter which file
204 modifications will trigger a build.
205 :github_included_regions: Override GitHub file paths to filter which file
206 modifications will trigger a build; must match parameter
207 gerrit_trigger_file_paths
209 Sample container-tag.yaml File
210 ------------------------------