{"_id":"573ed4bea233380e005db158","githubsync":"","user":"56b86c990094520d006b3c33","parentDoc":null,"version":{"_id":"573ed4bea233380e005db14d","__v":2,"project":"56b86cc286d2b0190070bcda","createdAt":"2016-05-20T09:11:26.847Z","releaseDate":"2016-05-20T09:11:26.847Z","categories":["573ed4bea233380e005db14e","573ed4bea233380e005db14f","573ed4bea233380e005db150","578bcf36bb7d810e00e01c05"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"master","version_clean":"0.3.0-0.4","version":"0.3-0.4"},"category":{"_id":"573ed4bea233380e005db14f","__v":0,"version":"573ed4bea233380e005db14d","project":"56b86cc286d2b0190070bcda","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-08T11:20:51.134Z","from_sync":false,"order":1,"slug":"tasks","title":"Tasks"},"project":"56b86cc286d2b0190070bcda","__v":1,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-09T14:12:15.907Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":8,"body":"Creates or updates a YAML configuration file. When the same file with a .yml.dist extension is available the task will use that file as template.\n\n## Configuration options\n\n| Name                        | Type     | Default value | Description                                                     |\n|-----------------------------|----------|---------------|-----------------------------------------------------------------|\n| configurationFile           | string   |               | The location of the YAML configuration file within the release. |\n| configuration               | array    |               | The configuration to be added to the YAML configuration file.   |\n| stageSpecificConfigurations | array    |               | The configuration to be added to the YAML configuration file based on the stage being installed to. |\n| generateValueForParameters  | string[] |               | An array with configuration keys that require generation of a SHA1 hash value. |\n\n\n### Configuring stage specific configuration\nWith the `stageSpecificConfigurations` option you are able to add configuration that should only be added when installing a release to a specific stage.\n\nThe following example shows a specific key being set with a different value per stage:\n``` json\n{\n    \"class\": \"Accompli\\\\Task\\\\YamlConfigurationTask\",\n    \"configurationFile\": \"/app/config/parameters.yml\",\n    \"configuration\": {\n        \"parameters\": {\n            \"database_user\": \"aUsername\"\n        }\n    },\n    \"stageSpecificConfigurations\": {\n        \"production\": {\n            \"database_password\": \"aProductionPassword\"\n        },\n        \"acceptance\": {\n            \"database_password\": \"anAcceptancePassword\"\n        },\n        \"test\": {\n            \"database_password\": \"aTestPassword\"\n        }\n    }\n}\n```\n\n\n### Generating unique SHA1 hash values for a key within the YAML configuration\nTo generate a unique SHA1 hash value for a key you need to specify that key in the 'generateValueForParameters' configuration option.\nWhen the key is a child of another key you can use a dotted notation as lookup syntax.\n\nFor example:\n``` yml\nbar:\n    baz: ef343a878da56b9be18eb1455ce35f052b421249\n```\n\nWhen you specify 'bar.baz' with 'generateValueForParameters' the task will generate a new unique SHA1 hash value.\n\n# Event flow\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/W0FxCd4OTdClVg9fkcGt_YamlConfigurationTask.png\",\n        \"YamlConfigurationTask.png\",\n        \"884\",\n        \"454\",\n        \"#9a6a51\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"yamlconfigurationtask","type":"basic","title":"YamlConfigurationTask"}

YamlConfigurationTask


Creates or updates a YAML configuration file. When the same file with a .yml.dist extension is available the task will use that file as template. ## Configuration options | Name | Type | Default value | Description | |-----------------------------|----------|---------------|-----------------------------------------------------------------| | configurationFile | string | | The location of the YAML configuration file within the release. | | configuration | array | | The configuration to be added to the YAML configuration file. | | stageSpecificConfigurations | array | | The configuration to be added to the YAML configuration file based on the stage being installed to. | | generateValueForParameters | string[] | | An array with configuration keys that require generation of a SHA1 hash value. | ### Configuring stage specific configuration With the `stageSpecificConfigurations` option you are able to add configuration that should only be added when installing a release to a specific stage. The following example shows a specific key being set with a different value per stage: ``` json { "class": "Accompli\\Task\\YamlConfigurationTask", "configurationFile": "/app/config/parameters.yml", "configuration": { "parameters": { "database_user": "aUsername" } }, "stageSpecificConfigurations": { "production": { "database_password": "aProductionPassword" }, "acceptance": { "database_password": "anAcceptancePassword" }, "test": { "database_password": "aTestPassword" } } } ``` ### Generating unique SHA1 hash values for a key within the YAML configuration To generate a unique SHA1 hash value for a key you need to specify that key in the 'generateValueForParameters' configuration option. When the key is a child of another key you can use a dotted notation as lookup syntax. For example: ``` yml bar: baz: ef343a878da56b9be18eb1455ce35f052b421249 ``` When you specify 'bar.baz' with 'generateValueForParameters' the task will generate a new unique SHA1 hash value. # Event flow [block:image] { "images": [ { "image": [ "https://files.readme.io/W0FxCd4OTdClVg9fkcGt_YamlConfigurationTask.png", "YamlConfigurationTask.png", "884", "454", "#9a6a51", "" ] } ] } [/block]