Add hover and test for docker-image PutParams

This commit is contained in:
Kris De Volder
2017-01-22 14:58:52 -08:00
parent d9cf71763a
commit 981674faa9
18 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1 @@
*Optional.* The path of a directory containing a `Dockerfile` to build.

View File

@@ -0,0 +1,10 @@
*Optional.* A map of Docker build arguments.
Example:
```yaml
build_args:
do_thing: true
how_many_things: 2
email: me@yopmail.com
```

View File

@@ -0,0 +1,8 @@
Optional.* Path to a JSON file containing Docker build
arguments.
Example file contents:
```yaml
{ "email": "me@yopmail.com", "how_many_things": 1, "do_thing": false }
```

View File

@@ -0,0 +1,10 @@
*Optional.* Default `false`. When the `build` parameter is set,
first pull `image:tag` from the Docker registry (so as to use cached
intermediate images when building). This will cause the resource to fail
if it is set to `true` and the image does not exist yet.
Note: Since docker 1.10 docker images [do not contain all necessary metadata to
restore the build cache](https://github.com/docker/docker/issues/20316).
Additional metadata needs to be saved and re-applied after a docker pull to have
subsequent builds skip identical intermediate layers. This additional
metadata is stored as a very small separate image (`image:${cache_tag}-buildcache`)
in the repository of this resource.

View File

@@ -0,0 +1,5 @@
*Optional.* Default `tag`. The specific tag to pull before
building when `cache` parameter is set. Instead of pulling the same tag
that's going to be built, this allows picking a different tag like
`latest` or the previous version. This will cause the resource to fail
if it is set to a tag that does not exist yet.

View File

@@ -0,0 +1,2 @@
*Optional.* The path of the `Dockerfile` in the directory if
it's not at the root of the directory.

View File

@@ -0,0 +1 @@
*Optional.* A path to a file to `docker import` and then push.

View File

@@ -0,0 +1,2 @@
*Optional.* The path of a directory containing an image that was
fetched using this same resource with `save: true`.

View File

@@ -0,0 +1,3 @@
*Optional.* A path to a directory containing an image to `docker load`
before running `docker build`. The directory must have `image`,
`image-id`, `repository`, and `tag` present, i.e. the tree produced by `/in`.

View File

@@ -0,0 +1,2 @@
*Optional.* A path to a file to `docker load` and then push.
Requires `load_repository`.

View File

@@ -0,0 +1 @@
*Optional.* The repository of the image loaded from `load_file`.

View File

@@ -0,0 +1 @@
*Optional.* Default `latest`. The tag of image loaded from `load_file`.

View File

@@ -0,0 +1,2 @@
*Optional.* **DEPRECATED. Use `get` and `load` instead.** A
path to a repository to pull down, and then push to this resource.

View File

@@ -0,0 +1,2 @@
*Optional.* **DEPRECATED. Use `get` and `load` instead.** Default
`latest`. The tag of the repository to pull down via `pull_repository`.

View File

@@ -0,0 +1,2 @@
*Optional.* The value should be a path to a file containing the name
of the tag.

View File

@@ -0,0 +1,2 @@
*Optional.* Default `false`. If true, the pushed image will
be tagged as `latest` in addition to whatever other tag was specified.

View File

@@ -0,0 +1,3 @@
*Optional.* If specified, the tag read from the file will be
prepended with this string. This is useful for adding `v` in front of version
numbers.

View File

@@ -1224,6 +1224,24 @@ public class PipelineYamlEditorTest {
"- name: a-job\n" +
" plan:\n" +
" - put: my-docker-image\n" +
" params:\n" +
" build: path/to/docker/dir\n" +
" load: path/to/image\n" +
" dockerfile: path/to/Dockerfile\n"+
" cache: cache-it\n" +
" cache_tag: the-cache-tag\n" +
" load_base: path/to/base-image\n" +
" load_file: path/to/file-to-load\n" +
" load_repository: some-repo\n" +
" load_tag: some-tag\n" +
" import_file: path/to/file-to-import\n" +
" pull_repository: path/to/repository-to-pull\n" +
" pull_tag: tag-to-pull\n" +
" tag: path/to/file-containing-tag\n" +
" tag_prefix: v\n" +
" tag_as_latest: tag-latest\n" +
" build_args: the-build-args\n" +
" build_args_file: path/to/file-with-build-args.json\n" +
" get_params:\n" +
" save: save-it\n" +
" rootfs: tar-it\n" +
@@ -1231,11 +1249,33 @@ public class PipelineYamlEditorTest {
);
editor.assertProblems(
"cache-it|'boolean'",
"tag-latest|'boolean'",
"the-build-args|Expecting a 'Map'",
"save-it|'boolean'",
"tar-it|'boolean'",
"skip-it|'boolean'"
);
editor.assertHoverContains("build", "directory containing a `Dockerfile`");
editor.assertHoverContains("load", "directory containing an image");
editor.assertHoverContains("dockerfile", "path of the `Dockerfile` in the directory");
editor.assertHoverContains("cache", "first pull `image:tag` from the Docker registry");
editor.assertHoverContains("cache_tag", "specific tag to pull");
editor.assertHoverContains("load_base", "path to a directory containing an image to `docker load`");
editor.assertHoverContains("load_file", "path to a file to `docker load`");
editor.assertHoverContains("load_repository", "repository of the image loaded from `load_file`");
editor.assertHoverContains("load_tag", "tag of image loaded from `load_file`");
editor.assertHoverContains("import_file", "file to `docker import`");
editor.assertHoverContains("pull_repository", "repository to pull down");
editor.assertHoverContains("pull_tag", "tag of the repository to pull down");
editor.assertHoverContains(" tag:", "a path to a file containing the name"); // The word 'tag' occurs many times in editor so add use " tag: " to be precise
editor.assertHoverContains("tag_prefix", "prepended with this string");
editor.assertHoverContains("tag_as_latest", "tagged as `latest`");
editor.assertHoverContains("build_args", "map of Docker build arguments");
editor.assertHoverContains("build_args_file", "JSON file containing");
editor.assertHoverContains("save", "docker save");
editor.assertHoverContains("rootfs", "a `.tar` file of the image");
editor.assertHoverContains("skip_download", "Skip `docker pull`");