Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #192 from niels-nijens/yaml-configuration-task-docs
Browse files Browse the repository at this point in the history
Add documentation of stage specific configuration functionality in YamlConfigurationTask
  • Loading branch information
niels-nijens committed Jul 16, 2016
2 parents b40fb76 + 81e33f2 commit 7df87a1
Showing 1 changed file with 39 additions and 9 deletions.
48 changes: 39 additions & 9 deletions docs/tasks/YamlConfigurationTask.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,45 @@

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.

## Generating unique SHA1 hash values for a key within the YAML configuration
## 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.

Expand All @@ -15,13 +52,6 @@ bar:

When you specify 'bar.baz' with 'generateValueForParameters' the task will generate a new unique SHA1 hash value.

# 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. |
| generateValueForParameters | string[] | | An array with configuration keys that require generation of a SHA1 hash value. |

# Event flow
## Event flow
![Flowchart with highlighted events YamlConfigurationTask is listening to](../images/event-flows/YamlConfigurationTask.png)

0 comments on commit 7df87a1

Please sign in to comment.