Skip to content

Define a parameter source from a dependency output #385

@carolynvs

Description

@carolynvs

Porter has the concept of a parameter source that is populated from dependency output. For example:

The wordpress bundle has a dependencies custom section that requires the mysql bundle. The mysql bundle generates a connstr output representing the connection string to the database. The parameter source dependencies.output allows the wordpress bundle to inject the connstr output from mysql to one of its parameters so that it can use the connection string created by the mysql bundle.

{
    "custom": {
        "io.cnab.dependencies": {
            "requires": {
                "mysql": {
                    "bundle": "mysql:v0.5.7"
                }
            }
        },
        "io.cnab.parameter-sources": {
            "porter-connstr": {
                "priority": [
                    "dependencies.output"
                ],
                "sources": {
                    "dependencies.output": {
                        "dependency": "mysql",
                        "name": "connstr"
                    }
                }
            }
        }
    }
}

This seems useful to have in the CNAB spec for parameter sources. So that if a bundle has a dependency defined, the author can choose to default a parameter using a dependency output and have it supported across tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions