diff --git a/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java b/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java index 7ae77c52a..efd65aa73 100644 --- a/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java +++ b/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java @@ -515,6 +515,8 @@ public class PipelineYmlSchema implements YamlSchema { addProp(put, "cache_tag", t_ne_string); addProp(put, "dockerfile", t_ne_string); addProp(put, "import_file", t_ne_string); + addProp(put, "labels", t_string_params); + addProp(put, "labels_file", t_ne_string); addProp(put, "load", t_ne_string); addProp(put, "load_base", t_ne_string); addProp(put, "load_bases", t_strings); @@ -523,7 +525,9 @@ public class PipelineYmlSchema implements YamlSchema { addProp(put, "load_tag", t_ne_string); addProp(put, "pull_repository", t_ne_string).isDeprecated(true); addProp(put, "pull_tag", t_ne_string).isDeprecated(true); - addProp(put, "tag", t_ne_string); + addProp(put, "tag", t_ne_string).isDeprecated(true); + addProp(put, "tag_file", t_ne_string); + addProp(put, "tag_as_latest", t_boolean); addProp(put, "tag_prefix", t_ne_string); addProp(put, "target_name", t_ne_string); diff --git a/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/build_args.md b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/build_args.md index 71f7bf1bc..31fc80f84 100644 --- a/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/build_args.md +++ b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/build_args.md @@ -1,10 +1,15 @@ -*Optional.* A map of Docker build arguments. +*Optional.* A map of Docker build-time variables. These will be available as environment variables during the Docker build. + +While not stored in the image layers, they are stored in image metadata and so it is recommend to avoid using these to pass secrets into the build context. In multi-stage builds ARGs in earlier stages will not be copied to the later stages, or in the metadata of the final stage. + +The [build metadata](https://concourse-ci.org/implementing-resources.html#resource-metadata) environment variables provided by Concourse will be expanded in the values (the syntax is `$SOME_ENVVAR` or `${SOME_ENVVAR}`). Example: -```yaml +``` build_args: - do_thing: true - how_many_things: 2 - email: me@yopmail.com -``` \ No newline at end of file + DO_THING: true + HOW_MANY_THINGS: 2 + EMAIL: me@yopmail.com + CI_BUILD_ID: concourse-$BUILD_ID +``` diff --git a/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/labels.md b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/labels.md new file mode 100644 index 000000000..2dbbae0c8 --- /dev/null +++ b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/labels.md @@ -0,0 +1,9 @@ +*Optional*. A map of labels that will be added to the image. + +Example: + +``` +labels: + commit: b4d4823 + version: 1.0.3 +``` diff --git a/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/labels_file.md b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/labels_file.md new file mode 100644 index 000000000..fb5565783 --- /dev/null +++ b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/labels_file.md @@ -0,0 +1,7 @@ +*Optional*. Path to a JSON file containing the image labels. + +Example file contents: + +``` +{ "commit": "b4d4823", "version": "1.0.3" } +``` diff --git a/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/tag.md b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/tag.md index 6a46f0cd4..4f206d40e 100644 --- a/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/tag.md +++ b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/tag.md @@ -1,2 +1 @@ -*Optional.* The value should be a path to a file containing the name -of the tag. \ No newline at end of file +**DEPRECATED - Use `tag_file` instead** diff --git a/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/tag_file.md b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/tag_file.md new file mode 100644 index 000000000..8c423dff9 --- /dev/null +++ b/headless-services/concourse-language-server/src/main/resources/desc/DockerImagePutParams/tag_file.md @@ -0,0 +1 @@ +*Optional*. The value should be a path to a file containing the name of the tag. diff --git a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java index 3dd75ef16..47b0ffcea 100644 --- a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java +++ b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java @@ -1819,9 +1819,12 @@ public class ConcourseEditorTest { " load_repository: some-repo\n" + " load_tag: some-tag\n" + " import_file: path/to/file-to-import\n" + + " labels: labels-map\n" + + " labels_file: path/to/file-with-labels\n" + " pull_repository: path/to/repository-to-pull\n" + " pull_tag: tag-to-pull\n" + " tag: path/to/file-containing-tag\n" + + " tag_file: path/to/file-containing-tag\n" + " tag_prefix: v\n" + " tag_as_latest: tag-latest\n" + " build_args: the-build-args\n" + @@ -1837,8 +1840,11 @@ public class ConcourseEditorTest { "cache-it|'boolean'", "cache-from-value|Expecting a 'Sequence'", "load-bases-value|Expecting a 'Sequence'", + "labels-map|Expecting a 'Map", + "pull_repository|Deprecated", "pull_tag|Deprecated", + "tag|Deprecated", "tag-latest|'boolean'", "the-build-args|Expecting a 'Map'", @@ -1848,6 +1854,7 @@ public class ConcourseEditorTest { ); assertEquals(DiagnosticSeverity.Warning, editor.assertProblem("pull_repository").getSeverity()); assertEquals(DiagnosticSeverity.Warning, editor.assertProblem("pull_tag").getSeverity()); + assertEquals(DiagnosticSeverity.Warning, editor.assertProblem("tag").getSeverity()); editor.assertHoverContains("build", "directory containing a `Dockerfile`"); editor.assertHoverContains("load", "directory containing an image"); @@ -1859,12 +1866,15 @@ public class ConcourseEditorTest { 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("labels", "map of labels that will be added to the image"); + editor.assertHoverContains("labels_file", "Path to a JSON file containing the image labels"); + editor.assertHoverContains("pull_repository", "DEPRECATED"); + editor.assertHoverContains("pull_tag", "DEPRECATED"); + editor.assertHoverContains(" tag:", "DEPRECATED - Use `tag_file` instead"); // The word 'tag' occurs many times in editor so use " tag: " to be precise + editor.assertHoverContains("tag_file", "path to a file containing the name"); editor.assertHoverContains("tag_as_latest", "tagged as `latest`"); - editor.assertHoverContains("build_args", "map of Docker build arguments"); + editor.assertHoverContains("tag_prefix", "prepended with this string"); + editor.assertHoverContains("build_args", "map of Docker build-time variables"); editor.assertHoverContains("build_args_file", "JSON file containing"); editor.assertHoverContains("save", "docker save"); editor.assertHoverContains("rootfs", "a `.tar` file of the image");