Skip to content

Commit

Permalink
Add support for missing properties in...
Browse files Browse the repository at this point in the history
... CF resource 'put' params in Concourse Editor.

Adding support for the following:

- vars
- vars_files
- docker_username
- docker_password
- show_app_log
- no_start

See: #330
  • Loading branch information
kdvolder committed Jul 23, 2019
1 parent e7d166c commit ecd2393
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,13 @@ private void initializeDefaultResourceTypes() {
addProp(put, "path", t_ne_string);
addProp(put, "current_app_name", t_ne_string);
addProp(put, "environment_variables", t_string_params);
addProp(put, "vars", t_params);
addProp(put, "vars_files", t_strings);
addProp(put, "docker_username", t_ne_string);
addProp(put, "docker_password", t_ne_string);
addProp(put, "show_app_log", t_boolean);
addProp(put, "no_start", t_boolean);
put.require(Constraints.mutuallyExclusive("no_start", "current_app_name"));

resourceTypes.def("cf", source, get, put);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*Optional*. This should be the users password when authenticating against a protected docker registry.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*Optional*. This is used as the username to authenticate against a protected docker registry.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*Optional*. Deploys the app but does not start it. This parameter is ignored when `current_app_name` is specified.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*Optional*. Tails the app log during startup, useful to debug issues when using blue/green deploys together with the `current_app_name` option.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*Optional*. Map of variables to pass to manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*Optional*. List of variables files to pass to manifest.
Original file line number Diff line number Diff line change
Expand Up @@ -4561,7 +4561,7 @@ public void gotoResourceTypeDefinition() throws Exception {
editor.assertHoverContains("verbose", "Invoke `cf` cli using `CF_TRACE=true`");
}

@Test public void cfPutParamsHovers() throws Exception {
@Test public void cfPutParamsReconcileAndHovers() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: pws\n" +
Expand All @@ -4576,12 +4576,30 @@ public void gotoResourceTypeDefinition() throws Exception {
" current_app_name: the-name\n" +
" environment_variables:\n" +
" key: value\n" +
" key2: value2\n"
" key2: value2\n" +
" vars: {}\n" +
" vars_files: []\n" +
" docker_username: mike\n" +
" docker_password: ((secret))\n" +
" show_app_log: true\n" +
" no_start: false\n"
);

editor.assertProblems(
"current_app_name|Only one of 'no_start' and 'current_app_name' should be defined",
"no_start|Only one of 'no_start' and 'current_app_name' should be defined"
);

editor.assertHoverContains("manifest", "Path to a application manifest file");
editor.assertHoverContains("path", "Path to the application to push");
editor.assertHoverContains("current_app_name", "zero-downtime deploy");
editor.assertHoverContains("environment_variables", "Environment variables");
editor.assertHoverContains("vars", "variables to pass");
editor.assertHoverContains("vars_files", "variables files to pass");
editor.assertHoverContains("docker_username", "username to authenticate");
editor.assertHoverContains("docker_password", "password when authenticating");
editor.assertHoverContains("show_app_log", "Tails the app log");
editor.assertHoverContains("no_start", "does not start it");
}

@Test public void bug_152918825_no_reconciling_for_double_parens_placeholders() throws Exception {
Expand Down

0 comments on commit ecd2393

Please sign in to comment.