### Porter Installations Output Show Examples Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_output_show.md Examples demonstrating how to use the 'porter installations output show' command to display installation output. ```bash porter installation output show kubeconfig ``` ```bash porter installation output show subscription-id --installation azure-mysql ``` ```bash porter installation output show kubeconfig --run 01EZSWJXFATDE24XDHS5D5PWK6 ``` -------------------------------- ### Install Command Example: Helm3 Mixin Source: https://github.com/getporter/porter/blob/main/docs/content/mixin-dev-guide/commands.md This example shows the expected stdin for the install command when using the helm3 mixin. It details the configuration for installing a MySQL chart and defining output values. ```yaml install: - helm3: description: "Install MySQL" name: porter-ci-mysql chart: bitnami/mysql outputs: - name: mysql-root-password secret: ${ bundle.parameters.mysql-name } key: mysql-root-password - name: mysql-password secret: ${ bundle.parameters.mysql-name } key: mysql-password ``` -------------------------------- ### Bundle Installation Output Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/_index.md Example output from a successful bundle installation, showing execution details and success confirmation. ```text executing install action from examples/porter-hello (installation: /) Install Hello World Hello, porter execution completed successfully! ``` -------------------------------- ### Install Bundle with Parameter Set Source: https://github.com/getporter/porter/blob/main/docs/content/docs/introduction/concepts-and-components/intro-parameters.md Example of installing a bundle and specifying a parameter set using the --parameter-set flag. ```bash porter install -p myparamset ``` -------------------------------- ### Install Example Bundle with Sensitive Data Source: https://github.com/getporter/porter/blob/main/docs/content/blog/persist-sensitive-data-safely.md This command installs an example bundle that handles sensitive data. It is used to demonstrate the initial error when no secret store is configured. ```bash porter install --reference ghcr.io/getporter/examples/sensitive-data --param password=123a123 ``` -------------------------------- ### Porter Plugin Installation Output Source: https://github.com/getporter/porter/blob/main/docs/content/blog/install-multiple-plugins.md Example output showing successful installation of multiple plugins. Each line indicates a successfully installed plugin and its version. ```text installed azure plugin v1.0.1 (e361abc) installed kubernetes plugin v1.0.1 (f01c944) ``` -------------------------------- ### Example Install Steps with Mixins Source: https://github.com/getporter/porter/blob/main/docs/content/docs/development/authoring-a-bundle/create-a-bundle.md Illustrates how to define steps in the 'install' section of porter.yaml using the 'exec' and 'terraform' mixins. Each step can have an optional description and mixin-specific parameters. ```yaml install: - exec: description: Optional description of the step # ... mixin specific values - terraform: description: Optional description of the step # ... mixin specific values ``` -------------------------------- ### Installation Information Output Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/_index.md Example output from the 'porter show' command, detailing the installation's name, bundle, version, timestamps, and execution history. ```text Name: hello Bundle: ghcr.io/getporter/examples/porter-hello Version: 0.2.0 Created: 2021-05-24 Modified: 2021-05-24 History: ------------------------------------------------------------------------ Run ID Action Timestamp Status Has Logs ------------------------------------------------------------------------ 01F1SVDSQDVKGC0VAABZE9ERQK install 2021-03-27 failed true 01F1SVVRGSWG3FKY2ZATN4XTKC install 2021-03-27 succeeded true ``` -------------------------------- ### Example: Install MySQL Release Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/helm2.md An example of installing a MySQL release using the Helm v2 mixin, including setting specific values and defining outputs for secrets and service cluster IP. ```yaml install: - helm: description: "Install MySQL" name: mydb chart: bitnami/mysql version: 6.14.2 namespace: mydb replace: true set: db.name: wordpress db.user: wordpress outputs: - name: mysql-root-password secret: mydb-mysql key: mysql-root-password - name: mysql-password secret: mydb-mysql key: mysql-password - name: mysql-cluster-ip resourceType: service resourceName: porter-ci-mysql-service namespace: "default" jsonPath: "{.spec.clusterIP}" ``` -------------------------------- ### Bundle Installation List Output Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/_index.md Example output from the 'porter list' command, displaying metadata for installed bundles. ```text NAME CREATED MODIFIED LAST ACTION LAST STATUS porter-hello 21 minutes ago 21 minutes ago install succeeded ``` -------------------------------- ### Install Command Output: MySQL Password Source: https://github.com/getporter/porter/blob/main/docs/content/mixin-dev-guide/commands.md This example shows the content of the '/cnab/app/porter/outputs/mysql-password' file after the install command is executed. ```plaintext alsotopsecret ``` -------------------------------- ### Install Hello World Bundle Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/examples/hello.md Install the 'hello world' bundle using the `porter install` command. This command deploys the bundle to your environment. ```console porter install hello --reference ghcr.io/getporter/examples/porter-hello:v0.2.0 ``` -------------------------------- ### Example Bundle porter.yaml Source: https://github.com/getporter/porter/blob/main/docs/content/docs/introduction/concepts-and-components/intro-bundles.md This snippet shows an example of a porter.yaml file, which defines a bundle's metadata, parameters, outputs, and execution steps for installation, upgrade, and uninstallation. ```yaml schemaVersion: 1.0.0-alpha.1 name: examples/porter-hello version: 0.2.0 description: "An example Porter configuration" registry: ghcr.io/getporter parameters: - name: name type: string default: porter path: /cnab/app/foo/name.txt source: output: name outputs: - name: name path: /cnab/app/foo/name.txt mixins: - exec install: - exec: description: "Install Hello World" command: ./helpers.sh arguments: - install upgrade: - exec: description: "World 2.0" command: ./helpers.sh arguments: - upgrade uninstall: - exec: description: "Uninstall Hello World" command: ./helpers.sh arguments: - uninstall ``` -------------------------------- ### Install a Bundle with Porter Go Library Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/library/_index.md This snippet shows how to install a Porter bundle using the Go library. It demonstrates creating a `porter.Porter` instance, setting install options including the bundle reference, validating the options, and then executing the install. It also shows how to retrieve the installation status afterward. Always call `opts.Validate` before executing. ```go package examples_test import ( "context" "fmt" "log" "get.porter.sh/porter/pkg/porter" ) func ExamplePorter_install() { // Create an instance of the Porter application p := porter.New() // Specify any of the command-line arguments to pass to the install command installOpts := porter.NewInstallOptions() // install a bundle with older cnab bundle schema version. It should succeed installOpts.Reference = "ghcr.io/getporter/examples/porter-hello:v0.2.0" // Always call validate on the options before executing. There is defaulting // logic in the Validate calls. const installationName = "porter-hello" err := installOpts.Validate(context.Background(), []string{installationName}, p) if err != nil { log.Fatal(err) } // porter install porter-hello --reference ghcr.io/getporter/examples/porter-hello:v0.2.0 err = p.InstallBundle(context.Background(), installOpts) if err != nil { log.Fatal(err) } // Get the bundle's status after installing. showOpts := porter.ShowOptions{} err = showOpts.Validate([]string{installationName}, p.Context) if err != nil { log.Fatal(err) } installation, _, err := p.GetInstallation(context.Background(), showOpts) if err != nil { log.Fatal(err) } fmt.Println(installation.Status) } ``` -------------------------------- ### Bundle Example: Persisting VM ID Source: https://github.com/getporter/porter/blob/main/docs/content/docs/development/authoring-a-bundle/persisting-data.md This example demonstrates how to capture a VM instance ID as a bundle output during installation and use it as a parameter for upgrade and uninstall actions. ```yaml schemaVersion: 1.0.1 name: my-vm-bundle version: 0.1.0 mixins: - exec # Declare the bundle-level output outputs: - name: instance-id type: string description: The ID of the created virtual machine applyTo: - install # Define a parameter that sources its value from the output parameters: - name: instance-id type: string description: The virtual machine instance ID # This parameter only applies to upgrade and uninstall # During install, we generate it; we don't need it as input applyTo: - upgrade - uninstall source: output: instance-id install: - exec: description: "Create virtual machine" command: create-vm arguments: - --name - myvm - --format - json # Capture the output from the command outputs: - name: instance-id jsonPath: ".id" upgrade: - exec: description: "Upgrade virtual machine" command: echo arguments: - "Upgrading VM: ${bundle.parameters.instance-id}" uninstall: - exec: description: "Delete virtual machine" command: delete-vm arguments: - --id - "${bundle.parameters.instance-id}" ``` -------------------------------- ### Porter Installation File Example (YAML) Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/file-formats/installation/1.0.2.md This snippet shows a complete Porter Installation resource defined in YAML format. It includes required fields like schemaType, schemaVersion, name, namespace, and bundle details. It also demonstrates how to specify bundle repository, digest, version, or tag, along with parameter sets, credential sets, and custom parameters. ```yaml schemaType: Installation schemaVersion: 1.0.2 name: myinstallation namespace: staging uninstalled: false labels: team: marketing customer: bigbucks bundle: repository: ghcr.io/getporter/examples/porter-hello # One of the following fields must be specified: digest, version, or tag digest: sha256:276b44be3f478b4c8d1f99c1925386d45a878a853f22436ece5589f32e9df384 version: 0.2.0 tag: latest parameterSets: - myparams credentialSets: - mycreds parameters: log-level: 11 ``` -------------------------------- ### Install a Bundle Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/_index.md Installs the 'porter-hello' bundle from the GitHub container registry. This command initiates the bundle's installation process. ```bash porter install porter-hello --reference ghcr.io/getporter/examples/porter-hello:v0.2.0 ``` -------------------------------- ### Install Command Output: MySQL Root Password Source: https://github.com/getporter/porter/blob/main/docs/content/mixin-dev-guide/commands.md This example shows the content of the '/cnab/app/porter/outputs/mysql-root-password' file after the install command is executed. ```plaintext topsecret ``` -------------------------------- ### List Installation Outputs Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_output_list.md Use this command to list all outputs for a given installation. You can specify the installation by name. ```bash porter installation outputs list ``` ```bash porter installation outputs list --installation another-bundle ``` ```bash porter installation outputs list --run 01EZSWJXFATDE24XDHS5D5PWK6 ``` -------------------------------- ### Install a Porter Bundle Source: https://github.com/getporter/porter/blob/main/docs/content/architecture.md Example command to install a Porter bundle using a specified credential set, parameter set, and bundle reference. This is the primary interface for end-users to deploy applications packaged as bundles. ```bash porter install --credential-set USER_CREDS --parameter-set CUSTOM_PARAMETERS --reference BUNDLE_REFERENCE ``` -------------------------------- ### Accessing Bundle Outputs in Subsequent Steps Source: https://github.com/getporter/porter/blob/main/docs/content/docs/development/authoring-a-bundle/using-templates.md This example shows how to capture an output from one step (e.g., generating a username) and use it as a parameter in a subsequent step (e.g., installing a Helm chart). ```yaml install: - exec: description: "Generate username" command: ./helpers.sh arguments: - generateUsername outputs: - name: username regex: "(.*)" # Capture all of stdout - helm3: description: "Install my chart" name: "myRelease" chart: "myChart" version: "1.2.3" namespace: "myNamespace" set: wordpress-username: ${ bundle.outputs.username } ``` -------------------------------- ### Exec Mixin: Run a Command Example Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/exec.md Example of using the exec mixin to run a command with arguments. This snippet executes 'make install'. ```yaml install: - exec: description: "Install Hello World" command: make arguments: - install ``` -------------------------------- ### Full Porter Bundle Example with Docker Mixin Source: https://github.com/getporter/porter/blob/main/docs/content/blog/using-docker-in-bundles.md A comprehensive porter.yaml example demonstrating the use of the docker mixin across different bundle lifecycle stages (install, upgrade, say, uninstall) to run a 'whalesay' container with varying arguments. ```yaml name: examples/whalesay version: 0.2.0 description: "An example bundle that uses docker through the magic of whalespeak" registry: ghcr.io/getporter required: - docker parameters: - name: msg description: a message for the whales to speak type: string default: "whale hello there!" applyTo: - say mixins: - docker install: - docker: run: image: "ghcr.io/getporter/examples/images/whalesay:latest" rm: true arguments: - cowsay - Hello World upgrade: - docker: run: image: "ghcr.io/getporter/examples/images/whalesay:latest" rm: true arguments: - cowsay - World 2.0 say: - docker: run: image: "ghcr.io/getporter/examples/images/whalesay:latest" rm: true arguments: - cowsay - ${ bundle.parameters.msg } uninstall: - docker: run: image: "ghcr.io/getporter/examples/images/whalesay:latest" rm: true arguments: - cowsay - Goodbye World ``` -------------------------------- ### Install a Bundle Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_install.md The basic command to install a bundle. The installation name defaults to the bundle name. ```bash porter installations install [INSTALLATION] [flags] ``` -------------------------------- ### AKS Integration Install Action Source: https://github.com/getporter/porter/blob/main/docs/content/docs/integrations/aks.md Example install action for a Porter bundle that integrates with AKS. It logs in to Azure, sets the subscription, retrieves AKS credentials, and deploys a pod using the Kubernetes mixin. ```bash install: - az: description: "Azure CLI login" arguments: - login flags: service-principal: username: ${ bundle.credentials.azure_client_id } password: ${ bundle.credentials.azure_client_secret } tenant: ${ bundle.credentials.azure_tenant_id } - az: description: "Azure set subscription Id" arguments: - "account" - "set" flags: subscription: ${ bundle.credentials.azure_subscription_id } - az: description: "Get access creds for AKS" arguments: - "aks" - "get-credentials" flags: resource-group: ${ bundle.parameters.rg_name } name: ${ bundle.parameters.aks_name } - kubernetes: description: "Deploy nginx pod" manifests: - cnab/app/nginx wait: true surpress-output: false outputs: - name: pod_name resourceType: "pod" resourceName: "basic-nginx" namespace: "default" jsonPath: "metadata.name" ``` -------------------------------- ### Porter Bundle Manifest Example (1.1.0) Source: https://github.com/getporter/porter/blob/main/docs/content/docs/bundle/manifest/file-format/1.1.0.md This is a complete example of a `porter.yaml` file for version 1.1.0, showcasing bundle metadata, maintainers, custom settings, required parameters, mixins, credentials, parameters, state, dependencies (including provides and requires), outputs, images, and lifecycle actions (install, upgrade, uninstall, poke, status). ```yaml schemaType: Bundle schemaVersion: 1.1.0 name: myapp version: 1.0.0 description: Install my great application registry: localhost:5000 reference: localhost:5000/myapp:v1.0.0 dockerfile: template.Dockerfile maintainers: - name: Qi Lu - email: sal@example.com - name: Frank url: https://example.com/frank custom: app: version: 1.2.3 commit: abc123 required: - docker: privileged: true mixins: - exec - helm3: clientVersion: 3.1.2 credentials: - name: kubeconfig description: A kubeconfig with cluster admin role path: /root/.kube/config - name: token env: GITHUB_TOKEN applyTo: - release parameters: - name: log-level description: Log level for MyApp type: integer env: MYAPP_LOG_LEVEL applyTo: - install - upgrade - name: connstr description: MyApp database connection string type: string env: MYAPP_CONNECTION_STRING sensitive: true source: dependency: mysql output: admin-connstr applyTo: - upgrade - status - name: release-name type: string env: RELEASE default: myapp state: - name: tfstate description: Store terraform state with the bundle instead of a remote backend path: terraform/terraform.tfstate dependencies: provides: interface: id: "https://example.com/interfaces/#something" requires: - name: mysql bundle: reference: getporter/mysql:v0.1.1 interface: id: "https://porter.sh/interfaces/#mysql" sharing: mode: group group: name: myapp parameters: database: myapp logLevel: ${bundle.parameters.log-level} credentials: kubeconfig: ${bundle.credentials.kubeconfig} outputs: admin-connstr: Server=${outputs.server};Database={outputs.database};Uid=admin;Pwd=${outputs.password}; outputs: - name: app-token description: Access token for MyApp type: file path: /cnab/app/myapp_token sensitive: true applyTo: - install - name: ip-address type: string images: myapp: repository: example/myapp digest: sha256:568461508c8d220742add8abd226b33534d4269868df4b3178fae1cba3818a6e install: - helm3: description: "Install MyApp" name: ${ bundle.parameters.release } chart: ./charts/myapp replace: true set: image.repository: ${ bundle.images.myapp.repository } image.digest: ${ bundle.images.myapp.digest } upgrade: - helm3: name: ${ bundle.parameters.release } chart: ./charts/myapp set: image.repository: ${ bundle.images.myapp.repository } image.digest: ${ bundle.images.myapp.digest } uninstall: - helm3: purge: true releases: - ${ bundle.parameters.release } poke: - exec: command: ./poke-myapp.sh customActions: status: description: See what's up in there modifies: false stateless: true status: - exec: command: ./status.sh ``` -------------------------------- ### Example porter.yaml for a New Bundle Source: https://github.com/getporter/porter/blob/main/docs/content/docs/introduction/concepts-and-components/intro-bundle-images.md This is a sample porter.yaml file generated when creating a new bundle with Porter. It defines the bundle's name, version, description, registry, and includes an 'exec' mixin for install, upgrade, and uninstall actions. ```yaml name: porter-hello version: 0.1.0 description: "An example Porter configuration" registry: getporter mixins: - exec install: - exec: description: "Install Hello World" command: ./helpers.sh arguments: - install upgrade: - exec: description: "World 2.0" command: ./helpers.sh arguments: - upgrade uninstall: - exec: description: "Uninstall Hello World" command: ./helpers.sh arguments: - uninstall ``` -------------------------------- ### Install Porter Bundle Using Reference Source: https://github.com/getporter/porter/blob/main/docs/content/blog/migrate-from-docker-app.md Install a Porter bundle using its OCI reference. This is the standard way to install published bundles. ```console $ porter install my-app --reference YOUR_BUNDLE_REFERENCE ``` ```console $ porter install my-app --reference carolynvs/my-docker-app:v0.1.0 ``` -------------------------------- ### Setup Porter Action Source: https://github.com/getporter/porter/blob/main/docs/content/docs/best-practices/ci-pipeline.md Integrate the Porter GitHub Action to automatically install Porter into your CI environment. Specify the desired Porter version for consistency. ```yaml - name: Setup Porter uses: getporter/gh-action@v0.1.1 with: porter_version: v0.27.2 ``` -------------------------------- ### Define Helm Install Step in Bundle Manifest Source: https://github.com/getporter/porter/blob/main/docs/content/docs/bundle/manifest/_index.md Example of a Helm 3 step within the 'install' action of a bundle manifest. It specifies the chart, version, and parameter overrides, along with defining outputs for credentials. ```yaml install: - helm3: description: "Install MySQL" name: mydb chart: bitnami/mysql version: 6.14.2 set: db.name: ${ bundle.parameters.database-name } db.user: ${ bundle.parameters.mysql-user } outputs: - name: mysql-root-password secret: mydb-creds key: mysql-root-password - name: mysql-password secret: mydb-creds key: mysql-password ``` -------------------------------- ### Full Porter Bundle Example with Docker Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/examples/docker.md A comprehensive porter.yaml file demonstrating the use of the Docker mixin for various bundle lifecycle stages (install, upgrade, say, uninstall). It includes parameter definitions and Docker command execution. ```yaml schemaVersion: 1.0.0-alpha.1 name: examples/whalesay version: 0.2.0 description: "An example bundle that uses docker through the magic of whalespeak" registry: ghcr.io/getporter required: - docker parameters: - name: msg description: a message for the whales to speak type: string default: "whale hello there!" applyTo: - say mixins: - docker install: - docker: run: image: "ghcr.io/getporter/examples/images/whalesay:latest" rm: true arguments: - cowsay - Hello World upgrade: - docker: run: image: "ghcr.io/getporter/examples/images/whalesay:latest" rm: true arguments: - cowsay - World 2.0 say: - docker: run: image: "ghcr.io/getporter/examples/images/whalesay:latest" rm: true arguments: - cowsay - "{{ bundle.parameters.msg }}" uninstall: - docker: run: image: "ghcr.io/getporter/examples/images/whalesay:latest" rm: true arguments: - cowsay - Goodbye World ``` -------------------------------- ### Install with Labels Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/install.md Installs a bundle and associates labels for organization and filtering. ```bash porter install --label env=dev --label owner=myuser ``` -------------------------------- ### Explain Bundle Credentials Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/credentials.md Use the `porter explain` command to view the credentials and parameters required by a bundle. This example shows a bundle that requires a GitHub token for installation and upgrade. ```console $ porter explain ghcr.io/getporter/examples/credentials-tutorial:v0.3.0 Name: examples/credentials-tutorial Description: An example Porter bundle with credentials. Uses your GitHub token to retrieve your public user profile from GitHub. Version: 0.3.0 Porter Version: v1.0.0-alpha.19 Credentials: -------------------------------------------------------------------------------- Name Description Required Applies To -------------------------------------------------------------------------------- github-token A GitHub Personal Access true install,upgrade Token. Generate one at https://github.com/settings/tokens. No scopes are required. Parameters: ------------------------------------------------------------------------------------ Name Description Type Default Required Applies To ------------------------------------------------------------------------------------ user A GitHub username. Defaults to string false install,upgrade the current user. ``` -------------------------------- ### Install a Specific Plugin by Name Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/plugins_install.md Installs the 'azure' plugin. ```bash porter plugin install azure ``` -------------------------------- ### Install a Bundle Source: https://github.com/getporter/porter/blob/main/docs/content/docs/development/authoring-a-bundle/create-a-bundle.md Use the `porter install` command to run the bundle's install action. This command can infer the bundle from the current directory if a `porter.yaml` file is present. ```console $ porter install mybundle executing install action from porter-hello (installation: /mybundle) Install Hello World Hello World execution completed successfully! ``` -------------------------------- ### Porter Installations Output Show Options Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_output_show.md Available options for the 'porter installations output show' command, including flags for specifying the installation, namespace, and bundle run. ```bash -h, --help help for show -i, --installation string Specify the installation to which the output belongs. -n, --namespace string Namespace in which the installation is defined. Defaults to the global namespace. -r, --run string The bundle run that generated the output. ``` -------------------------------- ### Show Bundle Installation Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/show.md Displays information about a bundle installation. You can specify the installation name or omit it to see all installations. Optional output formats include JSON and YAML. ```bash porter show porter show another-bundle ``` -------------------------------- ### Install a mixin from a feed URL Source: https://github.com/getporter/porter/blob/main/docs/content/blog/porter-package-search.md After searching for a mixin, you can install it using the `porter mixin install` command with the provided feed URL. This example installs the Terraform mixin. ```console $ porter mixin install terraform --feed-url https://cdn.porter.sh/mixins/atom.xml installed terraform mixin v0.5.1-beta.1 (597a442) ``` -------------------------------- ### Show Bundle Installation with JSON Output Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/show.md Displays information about a bundle installation in JSON format. This is useful for programmatic consumption of the installation details. ```bash porter show -o json ``` -------------------------------- ### Install the Bundle Source: https://github.com/getporter/porter/blob/main/docs/content/docs/contribute/tutorial.md Install the Porter bundle in the current directory. ```bash porter install ``` -------------------------------- ### Example Exec Mixin Schema for Install Action Source: https://github.com/getporter/porter/blob/main/docs/content/mixin-dev-guide/commands.md This example shows the portion of the Porter manifest used with the exec mixin schema for the install action. It defines the 'exec' object with properties like 'description', 'command', and 'arguments'. ```yaml install: - exec: description: Some description command: ./helpers.sh ``` -------------------------------- ### Install Bundle from File Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_install.md Installs a bundle using a local bundle.json file. ```bash porter installation install MyAppInDev --file myapp/bundle.json ``` -------------------------------- ### Install Bundle from File Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/install.md Installs a bundle using a local bundle.json file. ```bash porter install MyAppInDev --file myapp/bundle.json ``` -------------------------------- ### Install Porter Mixin Source: https://github.com/getporter/porter/blob/main/docs/content/docs/best-practices/ci-pipeline.md Install necessary Porter mixins for your bundle. The 'az' mixin is shown as an example. You can specify a version or install from a feed URL or GitHub URL. ```bash run: porter mixins install az ``` ```bash run: porter mixins install az --version v0.4.2 ``` ```bash porter mixins install NAME --feed-url ATOM_URL ``` ```bash porter mixins install NAME --url GITHUB_URL ``` -------------------------------- ### Docker Login Example Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/docker.md A basic example of initiating a Docker login command. ```yaml - docker: description: "Login to docker" login: ``` -------------------------------- ### Install Porter from Air-gapped Package Source: https://github.com/getporter/porter/blob/main/docs/content/docs/getting-started/install-porter.md Extracts and installs Porter from an air-gapped package. This process includes starting the MongoDB instance. ```bash tar -xzf porter-air-gapped-install-latest.tar.gz -C . cd porter-air-gapped-install-latest bash install-bundle.sh ``` -------------------------------- ### Install Bundle with Parameter from File Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_install.md Installs a bundle and loads a JSON configuration for a parameter from a file. ```bash porter installation install --param config=@config.json ``` -------------------------------- ### Uninstall Porter Resources Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/credentials.md Use the `porter uninstall` command to remove resources installed by a QuickStart. Specify the name of the installation to clean up. ```bash porter uninstall examples/credentials-tutorial ``` -------------------------------- ### Porter Installations Output Help Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_output.md Displays help information for the 'porter installations output' command, including available options. ```bash porter installations output --help ``` -------------------------------- ### Install Bundle from Reference with Namespace Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_install.md Installs a bundle from a specific OCI registry reference and assigns it to a namespace. ```bash porter installation install MyAppFromReference --reference ghcr.io/getporter/examples/kubernetes:v0.2.0 --namespace dev ``` -------------------------------- ### Kubernetes Mixin Install Example Source: https://github.com/getporter/porter/blob/main/docs/content/design/kubernetes-mixin.md This snippet demonstrates how to use the Kubernetes mixin within a Porter installation to deploy application manifests and define outputs. ```yaml install: - kubernetes: description: "Install Super Cool App" manifests: "/cnab/app/manifests/super-cool-app" outputs: - name: cluster_ip resourceType: "service" resourceName: "super-cool-service" namespace: "cool" jsonPath: "spec.clusterIP" ``` -------------------------------- ### Preview Documentation with Docker Source: https://github.com/getporter/porter/blob/main/CONTRIBUTING.md Start a local development server to preview documentation changes using Docker. The server watches for file changes. ```bash mage DocsPreview ``` -------------------------------- ### Show Installation Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_show.md Displays info relating to an installation of a bundle, including status and a listing of outputs. Optional output formats include json and yaml. ```bash porter installation show porter installation show another-bundle ``` -------------------------------- ### Install Azure Key Vault with Terraform Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/terraform.md Example of installing Azure Key Vault using the terraform mixin. It configures backend state storage and specifies outputs. ```yaml install: - terraform: description: "Install Azure Key Vault" input: false backendConfig: key: ${ bundle.name }.tfstate" storage_account_name: ${ bundle.credentials.backend_storage_account } container_name: ${ bundle.credentials.backend_storage_container } access_key: ${ bundle.credentials.backend_storage_access_key } outputs: - name: vault_uri ``` -------------------------------- ### Install a Plugin from a Specific URL Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/plugins_install.md Installs the 'azure' plugin from a direct download URL. ```bash porter plugin install azure --url https://cdn.porter.sh/plugins/azure ``` -------------------------------- ### Help Option for Create Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/bundles_create.md Displays help information for the 'create' subcommand. ```bash -h, --help help for create ``` -------------------------------- ### Uninstall Bundle Resources Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/parameters.md Use the `porter uninstall` command to clean up resources installed by the QuickStart. ```bash porter uninstall hello-llama ``` -------------------------------- ### Install with Parameter Set and Specific Parameters Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/install.md Installs a bundle using a predefined parameter set and overrides/sets specific parameters. ```bash porter install --parameter-set azure --param test-mode=true --param header-color=blue ``` -------------------------------- ### build command stdin example Source: https://github.com/getporter/porter/blob/main/docs/content/mixin-dev-guide/commands.md This is an example of the configuration and actions passed to the build command via stdin. ```yaml config: extensions: - iot actions: install: - az: arguments: - login description: Login uninstall: [] upgrade: [] ``` -------------------------------- ### Porter Manifest Example with Persistent Parameter Source: https://github.com/getporter/porter/blob/main/docs/content/docs/bundle/manifest/file-format/1.2.0.md This example demonstrates the 1.2.0 manifest format, including a persistent parameter named 'resource-group' that retains its value across bundle actions like install, upgrade, and uninstall. ```yaml schemaVersion: 1.2.0 name: myapp version: 1.0.0 registry: localhost:5000 mixins: - exec parameters: - name: resource-group type: string persistent: true install: - exec: description: "Deploy to ${bundle.parameters.resource-group}" command: deploy.sh upgrade: - exec: description: "Upgrade in ${bundle.parameters.resource-group}" command: upgrade.sh # resource-group is automatically provided from the install output uninstall: - exec: description: "Remove from ${bundle.parameters.resource-group}" command: teardown.sh # resource-group is automatically provided from the install output ``` -------------------------------- ### Install Bundle with Parameter Sets and Parameters Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_install.md Installs a bundle using predefined parameter sets and overrides specific parameters. ```bash porter installation install --parameter-set azure --param test-mode=true --param header-color=blue ``` -------------------------------- ### Override Parameter with CLI Flag Source: https://github.com/getporter/porter/blob/main/docs/content/docs/introduction/concepts-and-components/intro-parameters.md Example of overriding a specific parameter ('db_name') when installing a bundle, in addition to using a parameter set. ```bash porter install --param db_name=mydb -p myparamset ``` -------------------------------- ### Install Bundle from Reference with Namespace Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/install.md Installs a bundle from an OCI registry reference into a specific namespace. ```bash porter install MyAppFromReference --reference ghcr.io/getporter/examples/kubernetes:v0.2.0 --namespace dev ``` -------------------------------- ### MySQL Bundle Definition with Outputs Source: https://github.com/getporter/porter/blob/main/docs/content/wiring.md Example `porter.yaml` for a MySQL bundle that defines install actions and exposes sensitive outputs like database passwords. ```yaml name: mysql version: 0.1.3 registry: getporter mixins: - helm3: repositories: bitnami: url: "https://charts.bitnami.com/bitnami" credentials: - name: kubeconfig path: /home/nonroot/.kube/config parameters: - name: database-name type: string default: mydb env: DATABASE_NAME - name: mysql-user type: string env: MYSQL_USER install: - helm3: description: "Install MySQL" name: porter-ci-mysql chart: bitnami/mysql version: 6.14.2 replace: true set: db.name: ${ bundle.parameters.database-name } db.user: ${ bundle.parameters.mysql-user } outputs: - name: mysql-root-password secret: porter-ci-mysql key: mysql-root-password - name: mysql-password secret: porter-ci-mysql key: mysql-password ``` -------------------------------- ### Porter Installations Help Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations.md Displays help information for the 'porter installations' command. ```bash porter installations --help ``` -------------------------------- ### Docker Build Example Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/docker.md An example of building a Docker image with a specified tag and Dockerfile. ```yaml - docker: description: "Build image" build: tag: "gmadhok/cookies:v1.0" file: Dockerfile ``` -------------------------------- ### Porter Bundle with Persistent Resource Group Parameter Source: https://github.com/getporter/porter/blob/main/docs/content/docs/development/authoring-a-bundle/persisting-data.md Example porter.yaml demonstrating a persistent parameter for an Azure resource group. The value is remembered across install, upgrade, and uninstall operations. ```yaml schemaVersion: 1.2.0 name: my-bundle version: 0.1.0 registry: localhost:5000 mixins: - exec parameters: - name: resource-group type: string persistent: true description: Azure resource group name, remembered after install install: - exec: description: "Deploy to ${bundle.parameters.resource-group}" command: deploy.sh arguments: - "${bundle.parameters.resource-group}" upgrade: - exec: description: "Upgrade" command: upgrade.sh arguments: - "${bundle.parameters.resource-group}" # auto-populated from install uninstall: - exec: description: "Remove resources" command: teardown.sh arguments: - "${bundle.parameters.resource-group}" # auto-populated from install ``` -------------------------------- ### Using Dependency Outputs in a Helm Chart Source: https://github.com/getporter/porter/blob/main/docs/content/docs/development/authoring-a-bundle/using-templates.md This example demonstrates how to access an output from a declared dependency (e.g., a database password from a MySQL dependency) and use it to configure a Helm chart installation. ```yaml dependencies: requires: - name: mysql bundle: reference: getporter/mysql:v0.1.3 install: - helm3: description: "Install my chart" name: "myRelease" chart: "myChart" version: "1.2.3" namespace: "myNamespace" set: database-password: ${ bundle.dependencies.mysql.outputs.mysql-password } ``` -------------------------------- ### Porter Bundle Manifest Example Source: https://github.com/getporter/porter/blob/main/docs/content/docs/bundle/manifest/file-format/1.0.0-alpha.1.md A comprehensive example of a porter.yaml file, illustrating various sections like schemaVersion, name, version, description, registry, reference, dockerfile, maintainers, custom fields, required parameters, mixins, credentials, parameters, state, dependencies, outputs, images, and execution steps (install, upgrade, uninstall, poke). ```yaml schemaVersion: 1.0.0 name: myapp version: 1.0.0 description: Install my great application registry: localhost:5000 reference: localhost:5000/myapp:v1.0.0 dockerfile: template.Dockerfile maintainers: - name: Qi Lu - email: sal@example.com - name: Frank url: https://example.com/frank custom: app: version: 1.2.3 commit: abc123 required: - docker: privileged: true mixins: - exec - helm3: clientVersion: 3.1.2 credentials: - name: kubeconfig description: A kubeconfig with cluster admin role path: /root/.kube/config - name: token env: GITHUB_TOKEN applyTo: - release parameters: - name: log-level description: Log level for MyApp type: integer env: MYAPP_LOG_LEVEL applyTo: - install - upgrade - name: connstr description: MyApp database connection string type: string env: MYAPP_CONNECTION_STRING sensitive: true source: dependency: mysql output: admin-connstr applyTo: - install - status - name: release-name type: string env: RELEASE default: myapp state: - name: tfstate description: Store terraform state with the bundle instead of a remote backend path: terraform/terraform.tfstate dependencies: - name: mysql bundle: reference: getporter/mysql:v0.1.1 parameters: database: myapp outputs: - name: app-token description: Access token for MyApp type: file path: /cnab/app/myapp_token sensitive: true applyTo: - install - name: ip-address type: string images: myapp: repository: example/myapp digest: sha256:568461508c8d220742add8abd226b33534d4269868df4b3178fae1cba3818a6e install: - helm3: description: "Install MyApp" name: "{{ bundle.parameters.release }}" chart: ./charts/myapp replace: true set: image.repository: "{{ bundle.images.myapp.repository }}" image.digest: "{{ bundle.images.myapp.digest }}" upgrade: - helm3: name: "{{ bundle.parameters.release }}" chart: ./charts/myapp set: image.repository: "{{ bundle.images.myapp.repository }}" image.digest: "{{ bundle.images.myapp.digest }}" uninstall: - helm3: purge: true releases: - "{{ bundle.parameters.release }}" poke: - exec: command: ./poke-myapp.sh customActions: status: description: See what's up in there modifies: false stateless: true status: - exec: command: ./status.sh ``` -------------------------------- ### Show Installation Details Source: https://github.com/getporter/porter/blob/main/docs/content/docs/introduction/concepts-and-components/intro-credentials.md Display information about an existing installation, including the associated credential sets. ```console $ porter show tutorial Name: tutorial Namespace: quickstart Created: 3 minutes ago Modified: 7 seconds ago Bundle: Repository: ghcr.io/getporter/examples/credentials-tutorial Version: 0.2.0 Credential Sets: - carolyn-creds ``` -------------------------------- ### Example of porter-101 Error: Parameter Not Applied to Action Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/linter.md This snippet illustrates a common scenario for the porter-101 error where a parameter is defined to apply only to the 'uninstall' action but is referenced in the 'install' action's arguments. Ensure parameters are applied to all actions where they are referenced. ```yaml parameters: - name: uninstallParam type: string applyTo: - uninstall # Notice the parameter only applies to the uninstall action install: - exec: description: "Install Hello World" command: ./helpers.sh arguments: - install - "${ bundle.parameters.uninstallParam }" ``` -------------------------------- ### Docker Push Example Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/docker.md An example demonstrating how to push a Docker image with a specific tag. ```yaml - docker: description: "Push image" push: name: gmadhok/cookies tag: v1.0 ``` -------------------------------- ### Combine State and Parameter Sources in a Bundle Source: https://github.com/getporter/porter/blob/main/docs/content/docs/development/authoring-a-bundle/persisting-data.md This example demonstrates how to use state for Terraform's tfstate file and parameter sources to capture Terraform outputs for use in other commands. It shows configuration for state, outputs, and parameters, along with install and upgrade steps. ```yaml state: - name: tfstate path: terraform/terraform.tfstate outputs: - name: cluster-id type: string parameters: - name: cluster-id type: string source: output: cluster-id applyTo: - upgrade - uninstall install: - terraform: description: "Create cluster" - exec: description: "Capture cluster ID" command: bash flags: c: | # Extract output from Terraform and save as Porter output CLUSTER_ID=$(terraform output -raw cluster_id) mkdir -p /cnab/app/porter/outputs echo -n "$CLUSTER_ID" > /cnab/app/porter/outputs/cluster-id upgrade: - exec: description: "Configure cluster ${bundle.parameters.cluster-id}" command: configure-cluster arguments: - "${bundle.parameters.cluster-id}" - terraform: description: "Update infrastructure" ``` -------------------------------- ### Install Bundle with Default Parameters Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/parameters.md Install a bundle without specifying any parameters to observe its default behavior. This is useful for initial testing or when default values are sufficient. ```console $ porter install hello-llama --reference getporter/hello-llama:v0.1.1 installing hello-llama... executing install action from hello-llama (installation: hello-llama) Hello, llama execution completed successfully! ``` -------------------------------- ### Example Command Execution Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/exec.md This shows how the configured exec mixin translates into an actual command line execution. ```bash $ cmd arg1 arg2 -a flag-value --long-flag true --repeated-flag flag-value1 --repeated-flag flag-value2 suffix-arg1 ``` -------------------------------- ### List Porter Installations After Install Source: https://github.com/getporter/porter/blob/main/docs/content/docs/how-to-guides/work-with-plugins.md This command lists Porter installations, showing the newly installed bundle and its status, confirming the successful installation. ```console $ porter list NAME CREATED MODIFIED LAST ACTION LAST STATUS plugins-tutorial 51 seconds ago 49 seconds ago install success ``` -------------------------------- ### Apply Installation Desired State (Initial Install) Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/desired-state.md Use the `porter installation apply` command to import an installation definition and ensure its status matches the desired state. This command will trigger an install if the installation has not completed successfully yet. ```console $ porter installation apply installation.yaml Created demo/desired-state installation Triggering because the installation has not completed successfully yet The installation is out-of-sync, running the install action... # bundle output truncated for brevity ``` -------------------------------- ### Example: Provision a VM with AWS Mixin Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/aws.md Example configuration for provisioning a virtual machine using the EC2 service and run-instances operation. ```yaml aws: description: "Provision VM" service: ec2 operation: run-instances flags: image-id: ami-xxxxxxxx instance-type: t2.micro ``` -------------------------------- ### Create Project Directory Source: https://github.com/getporter/porter/blob/main/docs/content/blog/docker-mixin-blog-post.md Sets up the initial project directory for the Docker mixin practice. ```bash mkdir docker-mixin-practice; cd docker-mixin-practice; ``` -------------------------------- ### Install Multiple Porter Plugins Source: https://github.com/getporter/porter/blob/main/docs/content/blog/install-multiple-plugins.md Use the `porter plugins install` command with the `-f` flag to install plugins defined in a YAML file. This allows for batch installation of plugins. ```bash porter plugins install -f ``` -------------------------------- ### Show Installation Information Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/_index.md Displays detailed information about a specific bundle installation, including its history. ```bash porter show porter-hello ``` -------------------------------- ### Install Kubernetes Mixin Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/kubernetes.md Installs the Kubernetes mixin. Use this command to add the mixin to your Porter installation. ```shell porter mixin install kubernetes ``` -------------------------------- ### Show Imported Tutorial Parameter Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/desired-state.md Verify that the 'credentials-tutorial' parameter set was imported successfully by displaying its definition. This command shows the details of the imported parameters. ```console $ porter parameters show credentials-tutorial Name: credentials-tutorial Created: 0001-01-01 Modified: 5 seconds ago ---------------------------------- Name Local Source Source Type ---------------------------------- user getporterbot value ``` -------------------------------- ### Install Porter on Linux Source: https://github.com/getporter/porter/blob/main/docs/content/docs/getting-started/install-porter.md Installs a specific version of Porter on Linux by downloading and executing the installation script. ```bash export VERSION="v1.1.0" curl -L https://cdn.porter.sh/$VERSION/install-linux.sh | bash ``` -------------------------------- ### Install Porter on macOS Source: https://github.com/getporter/porter/blob/main/docs/content/docs/getting-started/install-porter.md Installs a specific version of Porter on macOS by downloading and executing the installation script. ```bash export VERSION="v1.1.0" curl -L https://cdn.porter.sh/$VERSION/install-mac.sh | bash ``` -------------------------------- ### Define Tutorial Parameter Set Source: https://github.com/getporter/porter/blob/main/docs/content/docs/quickstart/desired-state.md Define a parameter set named 'credentials-tutorial' with a 'user' parameter set to the value 'getporterbot'. Save this definition in `params.yaml`. ```yaml schemaVersion: 1.0.1 name: credentials-tutorial parameters: - name: user source: value: getporterbot ``` -------------------------------- ### Install Bundle with Labels Source: https://github.com/getporter/porter/blob/main/docs/content/docs/references/cli/installations_install.md Installs a bundle and associates it with specific labels for organization and filtering. ```bash porter installation install --label env=dev --label owner=myuser ``` -------------------------------- ### Install az mixin Source: https://github.com/getporter/porter/blob/main/docs/content/mixins/az.md Install the az mixin for Porter. This command fetches and installs the latest version of the mixin. ```bash porter mixin install az ```