-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
- Loading branch information
Showing
26 changed files
with
1,571 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
schemaVersion: 1.0.0-alpha.1 | ||
name: porter-hello | ||
description: "An example Porter configuration" | ||
version: 0.1.0 | ||
registry: "localhost:5000" | ||
|
||
credentials: | ||
- name: username | ||
description: Name of the database user | ||
required: false | ||
env: ROOT_USERNAME | ||
- name: password | ||
path: /tmp/password | ||
applyTo: | ||
- uninstall | ||
|
||
dependencies: | ||
requires: | ||
- name: mysql | ||
bundle: | ||
reference: "getporter/azure-mysql:5.7" | ||
|
||
mixins: | ||
- exec | ||
|
||
install: | ||
- exec: | ||
description: "Say Hello" | ||
command: bash | ||
flags: | ||
c: echo Hello World | ||
|
||
status: | ||
- exec: | ||
description: "Get World Status" | ||
command: bash | ||
flags: | ||
c: echo The world is on fire | ||
|
||
uninstall: | ||
- exec: | ||
description: "Say Goodbye" | ||
command: bash | ||
flags: | ||
c: echo Goodbye World |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package v2 | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
// Dependencies describes the set of custom extension metadata associated with the dependencies spec | ||
// https://github.com/cnabio/cnab-spec/blob/master/500-CNAB-dependencies.md | ||
type Dependencies struct { | ||
// Requires is a list of bundles required by this bundle | ||
Requires map[string]Dependency `json:"requires,omitempty" mapstructure:"requires"` | ||
} | ||
|
||
/* | ||
dependencies: | ||
requires: # dependencies are always created in the current namespace, never global though they can match globally? | ||
mysql: | ||
bundle: | ||
reference: getporter/mysql:v1.0.2 | ||
version: 1.x | ||
interface: # Porter defaults the interface based on usage | ||
reference: getporter/generic-mysql-interface:v1.0.0 # point to an interface bundle to be more specific | ||
bundle: # add extra interface requirements | ||
outputs: | ||
- $id: "mysql-5.7-connection-string" # match on something other than name, so that outputs with different names can be reused | ||
installation: | ||
labels: # labels applied to the installation if created | ||
app: myapp | ||
installation: {{ installation.name }} # exclusive resource | ||
criteria: # criteria for reusing an existing installation, by default must be the same bundle, labels and allows global | ||
matchInterface: true # only match the interface, not the bundle too | ||
matchNamespace: true # must be in the same namespace, disallow global | ||
ignoreLabels: true # allow different labels | ||
*/ | ||
|
||
// Dependency describes a dependency on another bundle | ||
type Dependency struct { | ||
// Name of the dependency | ||
Name string | ||
|
||
// Bundle is the location of the bundle in a registry, for example REGISTRY/NAME:TAG | ||
Bundle string `json:"bundle" mapstructure:"bundle"` | ||
|
||
// Version is a set of allowed versions | ||
Version string `json:"version,omitempty" mapstructure:"version"` | ||
|
||
Interface *DependencyInterface `json:"interface,omitempty" mapstructure:"interface,omitempty"` | ||
|
||
Installation *DependencyInstallation `json:"installation,omitempty" mapstructure:"installation,omitempty"` | ||
|
||
Parameters map[string]DependencySource `json:"parameters,omitempty" mapstructure:"parameters,omitempty"` | ||
Credentials map[string]DependencySource `json:"credentials,omitempty" mapstructure:"credentials,omitempty"` | ||
} | ||
|
||
type DependencySource struct { | ||
Value string `json:"value,omitempty" mapstructure:"value,omitempty"` | ||
Dependency string `json:"dependency,omitempty" mapstructure:"dependency,omitempty"` | ||
Credential string `json:"credential,omitempty" mapstructure:"credential,omitempty"` | ||
Parameter string `json:"parameter,omitempty" mapstructure:"parameter,omitempty"` | ||
Output string `json:"output,omitempty" mapstructure:"output,omitempty"` | ||
} | ||
|
||
type DependencyInstallation struct { | ||
Labels map[string]string `json:"labels,omitempty" mapstructure:"labels,omitempty"` | ||
Criteria *InstallationCriteria `json:"criteria,omitempty" mapstructure:"criteria,omitempty"` | ||
} | ||
|
||
type InstallationCriteria struct { | ||
// MatchInterface specifies if the installation should use the same bundle or just needs to match the interface | ||
MatchInterface bool `json:"matchInterface,omitempty" mapstructure:"matchInterface,omitEmpty"` | ||
MatchNamespace bool `json:"matchNamespace,omitempty" mapstructure:"matchNamespace,omitEmpty"` | ||
IgnoreLabels bool `json:"ignoreLabels,omitempty" mapstructure:"ignoreLabels,omitempty"` | ||
} | ||
|
||
type DependencyInterface struct { | ||
Reference string `json:"reference,omitempty" mapstructure:"reference,omitempty"` | ||
Document *json.RawMessage `json:"document,omitempty" mapstructure:"document,omitempty"` | ||
} |
Oops, something went wrong.