### Start dev environment with skaffold.yaml Source: https://docs.uffizzi.com/cli/commands/dev Starts a dev environment using a skaffold.yaml config file from the ~/foo directory. ```bash uffizzi dev start ~/foo/skaffold.yaml ``` -------------------------------- ### Configure deploy_preview_when_image_tag_is_created: standalone and override examples Source: https://docs.uffizzi.com/references/compose-spec Configure automatic preview deployment when a new image tag is created. The standalone example enables the option for the service `foo`; the override example disables it globally but enables it for `foo`, so previews are disabled for all services except `foo`. Requires webhooks on your container registry. ```yaml x-uffizzi: ingress: service: foo port: 80 services: foo: image: foo:latest x-uffizzi-continuous_previews: deploy_preview_when_image_tag_is_created: true ``` ```yaml x-uffizzi: ingress: service: foo port: 80 continuous-previews: deploy_preview_when_image_tag_is_created: false services: foo: image: foo:latest x-uffizzi-continuous_previews: deploy_preview_when_image_tag_is_created: true bar: image: bar:latest baz: image: baz:latest ``` -------------------------------- ### dev start command syntax Source: https://docs.uffizzi.com/cli/commands/dev Starts a Uffizzi dev cluster and the Skaffold process using a configuration file and optional options. ```bash uffizzi dev start [CONFIG_FILE] [OPTIONS] ``` -------------------------------- ### Create a dev cluster with uffizzi dev start Source: https://docs.uffizzi.com/quickstart/dev-clusters Run this command from the root of your project directory to start a dev cluster with an auto-generated name and a skaffold process that builds and deploys changes. The output shows the cluster name and a watching message. Use -q or --quiet for no output. ```bash uffizzi dev start # Start creating a cluster # Checking the cluster status... # Cluster with name: barrow-indigo was created. # ... # Press Ctrl+C to exit # Watching for changes... ``` -------------------------------- ### Start dev environment with alternate kubeconfig Source: https://docs.uffizzi.com/cli/commands/dev Starts a dev environment using an alternate kubeconfig file specified with --kubeconfig. ```bash uffizzi dev start --kubeconfig="/path/to/alternate/kubeconfig" ``` -------------------------------- ### uffizzi install command syntax Source: https://docs.uffizzi.com/cli/commands/install Shows the command syntax for installing the Uffizzi data plane. Replace HOSTNAME with the hostname for the Uffizzi Controller (e.g., uffizzi.example.com). The --email option is required for generating letsencrypt certificates. The --namespace option defaults to 'default' and --context defaults to the current Kubernetes context. The output is an IP address or hostname where the Controller service is available. ```bash uffizzi install [HOSTNAME] [OPTIONS] ``` -------------------------------- ### Clone the example application repository Source: https://docs.uffizzi.com/quickstart/virtual-clusters Clones the UffizziCloud/quickstart repository and changes into its directory. The repo contains a web.yaml manifest with service, ingress, and deployment resources. ```bash git clone https://github.com/UffizziCloud/quickstart.git && \ cd quickstart ``` -------------------------------- ### Install Uffizzi CLI via Homebrew Source: https://docs.uffizzi.com/install/cli Installs the Uffizzi CLI using Homebrew. Recommended method for macOS users. ```bash brew tap uffizzicloud/tap && \ brew install uffizzicloud/tap/uffizzi ``` -------------------------------- ### Install Uffizzi Business Platform Source: https://docs.uffizzi.com/install/platform/business Installs the Uffizzi Controller and Cluster Operator. Replace HOSTNAME, EMAIL, NAMESPACE, and CONTEXT with your values. The --email option is required for generating letsencrypt certificates. ```bash uffizzi install HOSTNAME --email EMAIL --namespace NAMESPACE --context CONTEXT ``` -------------------------------- ### Configure delete_preview_after: standalone and override examples Source: https://docs.uffizzi.com/references/compose-spec Configure automatic preview deletion after a specified number of hours. The standalone example sets `delete_preview_after: 24h` for `foo`; the override example sets a global 1-hour deletion but overrides it to 24 hours for `foo`. Accepts values from `1-720h`. ```yaml x-uffizzi: ingress: service: foo port: 80 services: foo: image: foo:latest x-uffizzi-continuous_previews: deploy_preview_when_image_tag_is_created: true delete_preview_after: 24h ``` ```yaml x-uffizzi: ingress: service: foo port: 80 continuous-previews: deploy_preview_when_image_is_created: true delete_preview_after: 1h services: foo: image: foo:latest x-uffizzi-continuous_previews: delete_preview_after: 24h bar: image: bar:latest ``` -------------------------------- ### Example skaffold.yaml using kaniko builder and Helm deployer Source: https://docs.uffizzi.com/dev-environments/skaffold This example skaffold.yaml is used to develop the Uffizzi platform. It uses the kaniko builder to build images on the cluster and the helm deployer to deploy the application using a Helm Chart. It also specifies a helm_values.yaml file that contains the values for the Helm chart. ```yaml apiVersion: skaffold/v4beta6 kind: Config build: artifacts: - image: uffizzi-platform context: . kaniko: {} sync: infer: - "**/*" cluster: {} manifests: helm: releases: - name: uffizzi chartPath: "charts/uffizzi-platform" skipBuildDependencies: true valuesFiles: - "./helm_values.yaml" ``` -------------------------------- ### Start a dev cluster with uffizzi dev start Source: https://docs.uffizzi.com/dev-environments/dev-clusters Run this command to create a dev cluster, passing the path to your skaffold.yaml file. It also saves the skaffold file location in the CLI configuration at .config/uffizzi/config_default.json. ```bash uffizzi dev start /path/to/skaffold.yaml ``` -------------------------------- ### Dockerfile with ARG declarations Source: https://docs.uffizzi.com/compose/reference Dockerfile example showing ARG declarations for build arguments. Note that ARG before FROM is not available in build instructions under FROM. ```dockerfile # syntax=docker/dockerfile:1 ARG buildno ARG gitcommithash RUN echo "Build number: $buildno" RUN echo "Based on commit: $gitcommithash" ``` -------------------------------- ### env_file format example Source: https://docs.uffizzi.com/compose/reference Shows the expected NAME=VALUE format for each line in an env file. ```plaintext FOO=bar ``` -------------------------------- ### deploy_preview_when_image_tag_is_created override example Source: https://docs.uffizzi.com/compose/reference Shows how to override a global continuous-previews setting for a specific service. In this example, previews are disabled for all services except 'foo' because the override is specified for that service. Requires webhooks configured on your container registry. ```yaml x-uffizzi: ingress: service: foo port: 80 continuous-previews: deploy_preview_when_image_tag_is_created: false services: foo: image: foo:latest x-uffizzi-continuous_previews: deploy_preview_when_image_tag_is_created: true bar: image: bar:latest baz: image: baz:latest ``` -------------------------------- ### Example Node.js application code (src/index.js) Source: https://docs.uffizzi.com/quickstart/dev-clusters This is the initial code of the Node.js application. Modify it to see changes auto-deployed to the dev cluster. ```javascript 'use strict'; const express = require('express') const app = express() app.use(express.static('public')); app.get('/', (req, res) => res.send('I love Uffizzi!')) const port = 8080 app.listen(port, () => console.log(`Example app listening on port ${port}!`)) ``` -------------------------------- ### Create A Record for DNS Source: https://docs.uffizzi.com/install/platform/business Create an A record for the Controller hostname if the install command outputs an IP address. Use your actual IP address for the Data field. ```markdown | Type | Name | Data | TTL | |----------|-----------------------|---------------|--------| | A | *.uffizzi.example.com | 34.132.250.26 | 1 hour | ``` -------------------------------- ### image with default registry example Source: https://docs.uffizzi.com/compose/reference Specifies an image using repository:tag. If no tag is specified, default is latest; if no registry is specified, default is hub.docker.com. ```yaml services: cache: image: redis:latest # Defaults to hub.docker.com ``` -------------------------------- ### Define named volume and share between services Source: https://docs.uffizzi.com/compose/reference Example of a two-service setup where a database's data directory is shared with a backup service via a named volume. The volume has a 1MB compressed size limit and read+write access by default. ```yaml services: db: image: db volumes: - ./some_init_db_data:/var/lib/db_init - /some_data:/var/lib/some_data - data-volume:/var/lib/db backup: image: backup-service volumes: - data-volume:/var/lib/backup/data volumes: data-volume: ``` -------------------------------- ### Create a virtual cluster with Uffizzi CLI Source: https://docs.uffizzi.com/quickstart/virtual-clusters Creates a virtual cluster named 'quickstart' on Uffizzi Cloud. Updates the current kubeconfig context so kubectl can interact with the cluster. ```bash uffizzi cluster create quickstart # [⠏] Creating cluster quickstart... ``` -------------------------------- ### Start dev environment in quiet mode Source: https://docs.uffizzi.com/cli/commands/dev Starts a dev environment in quiet mode, suppressing output. ```bash uffizzi dev start --quiet ``` -------------------------------- ### Get Uffizzi CLI configuration value Source: https://docs.uffizzi.com/usage/cli Gets the value of a specified configuration property, such as the server URL. ```shell uffizzi config get-value server ``` -------------------------------- ### uffizzi cluster create --manifest=manifests/ Source: https://docs.uffizzi.com/cli/commands/cluster Creates a cluster and applies manifests from a directory. ```bash uffizzi cluster create --manifest=manifests/ ``` -------------------------------- ### Select or create a project in the Uffizzi configuration wizard Source: https://docs.uffizzi.com/cli/configuration-options The wizard prompts you to select an existing project or create a new one. Use arrow keys and Enter to select. ```bash uffizzi config # ... # Select a project: (Press ↑/↓/←/→ arrow to move and Enter to select) # ‣ default # My Project # Create a new project ``` -------------------------------- ### Complete Uffizzi Preview Workflow Example Source: https://docs.uffizzi.com/ci/github-actions/compose/recipe Full GitHub Actions workflow that builds and pushes images for vote, worker, and result services to the Uffizzi ephemeral registry, then deploys a preview environment. Includes steps for checkout, UUID generation, Docker metadata, and build-push actions. ```yaml name: Build Images and Deploy Preview Environment on: pull_request: types: [opened,reopened,synchronize,closed] jobs: build-vote: name: Build and Push `vote` runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' || github.event.action != 'closed' }} outputs: tags: ${{ steps.meta.outputs.tags }} steps: - name: Checkout git repo uses: actions/checkout@v3 - name: Generate UUID image name id: uuid run: echo "UUID_VOTE=$(uuidgen)" >> $GITHUB_ENV - name: Docker metadata id: meta uses: docker/metadata-action@v4 with: # An anonymous, emphemeral registry built on ttl.sh images: registry.uffizzi.com/${{ env.UUID_VOTE }} tags: type=raw,value=24h - name: Build and Push Image to Uffizzi Ephemeral Registry uses: docker/build-push-action@v3 with: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} context: ./vote build-worker: name: Build and Push `worker` runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' || github.event.action != 'closed' }} outputs: tags: ${{ steps.meta.outputs.tags }} steps: - name: Checkout git repo uses: actions/checkout@v3 - name: Generate UUID image name id: uuid run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV - name: Docker metadata id: meta uses: docker/metadata-action@v4 with: # An anonymous, emphemeral registry built on ttl.sh images: registry.uffizzi.com/${{ env.UUID_WORKER }} tags: type=raw,value=24h - name: Build and Push Image to Uffizzi Ephemeral Registry uses: docker/build-push-action@v3 with: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} context: ./worker build-result: ``` -------------------------------- ### delete_preview_after override example Source: https://docs.uffizzi.com/compose/reference Shows how to override a global delete_preview_after setting for a specific service. In this example, 'foo' will be deleted after 24 hours instead of the global 1 hour. ```yaml x-uffizzi: ingress: service: foo port: 80 continuous-previews: deploy_preview_when_image_is_created: true delete_preview_after: 1h services: foo: image: foo:latest x-uffizzi-continuous_previews: delete_preview_after: 24h bar: image: bar:latest ``` -------------------------------- ### Create a preview environment Source: https://docs.uffizzi.com/usage/cli Creates an ephemeral preview environment from a Docker Compose configuration in the default account and project. ```bash uffizzi compose create docker-compose.uffizzi.yml ``` -------------------------------- ### Set the Uffizzi API server with the configuration wizard Source: https://docs.uffizzi.com/cli/configuration-options The wizard prompts for the server URL. Accept the default `app.uffizzi.com` for Uffizzi Cloud or enter your own API server URL. ```bash uffizzi config # ... # Server (app.uffizzi.com): ``` -------------------------------- ### share_to_github override example Source: https://docs.uffizzi.com/compose/reference Shows how to override the global share_to_github setting for a specific service. In this example, the preview URL will only be shared to GitHub when a pull request is opened on repository 'foo' (but not 'bar'). Requires connecting your GitHub account in the Uffizzi Dashboard. ```yaml x-uffizzi: ingress: service: foo port: 80 continuous_previews: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed: true share_to_github: false services: foo: build: context: https://github.com/example/foo#main x-uffizzi-continuous_previews: share_to_github: true bar: image: bar:latest ``` -------------------------------- ### Show help for the cluster create subcommand Source: https://docs.uffizzi.com/cli/commands/help Shows help for the `cluster create` subcommand. Use this to see specific options and usage details for creating a cluster. ```bash uffizzi cluster create help ``` -------------------------------- ### Show general help for Uffizzi CLI Source: https://docs.uffizzi.com/cli/commands/help Displays a list of all available commands and options in the Uffizzi CLI. Use this when you need a quick overview of the CLI's capabilities. ```bash uffizzi help ``` -------------------------------- ### image with custom registry example Source: https://docs.uffizzi.com/compose/reference Specifies an image from a custom registry using repository:tag format. ```yaml services: web: image: example.azurecr.io/example-service:latest ``` -------------------------------- ### Entrypoint and command as list Source: https://docs.uffizzi.com/compose/reference Shows entrypoint and command used together, with command expressed as a quoted list. ```yaml entrypoint: /usr/bin/nginx-debug command: - "-g" - "daemon off;" ``` -------------------------------- ### Delete a project with uffizzi project delete Source: https://docs.uffizzi.com/cli/commands/project Deletes a Uffizzi project with the given slug. Example uses `my-app-xc8fw`. ```bash uffizzi project delete my-app-xc8fw ``` -------------------------------- ### Create a preview with metadata labels Source: https://docs.uffizzi.com/usage/cli Adds metadata labels to the preview using the --set-labels option. ```bash uffizzi compose create docker-compose.uffizzi.yml \ --set-labels="github.repo=my_repo github.pull_request.number=23" ``` -------------------------------- ### Delete the virtual cluster Source: https://docs.uffizzi.com/quickstart/virtual-clusters Deletes the virtual cluster named 'quickstart' from Uffizzi Cloud. Expected output confirms the deletion. ```bash uffizzi cluster delete quickstart # Cluster quickstart deleted ``` -------------------------------- ### Launch the Uffizzi CLI configuration wizard Source: https://docs.uffizzi.com/cli/configuration-options Run `uffizzi config` to start the interactive configuration wizard. The configuration is stored in `~/.config/uffizzi/config_default.json`. ```bash uffizzi config ``` -------------------------------- ### Get the ingress host of the deployment Source: https://docs.uffizzi.com/quickstart/virtual-clusters Lists the ingress resources to find the host address. The output shows a host like 'web-default-quickstart-c831.uclusters.app.uffizzi.com'. ```bash kubectl get ingress # NAME CLASS HOSTS ADDRESS PORTS AGE # web uffizzi web-default-quickstart-c831.uclusters.app.uffizzi.com 80, 443 13m ``` -------------------------------- ### compose create syntax Source: https://docs.uffizzi.com/cli/commands/compose Shows the basic syntax for the `compose create` command. Use it to create a Docker Compose environment. See the Uffizzi Compose Reference for details. ```bash uffizzi compose create [COMPOSE_FILE] [FLAGS] ``` -------------------------------- ### Configure deploy_preview_when_pull_request_is_opened standalone and as override Source: https://docs.uffizzi.com/references/compose-spec Shows two ways to configure the 'deploy_preview_when_pull_request_is_opened' service-level option for Uffizzi CI. The first sets it as a standalone option on the service's x-uffizzi-continuous_previews. The second sets it globally under continuous-previews and overrides it per-service with false for 'example/foo', while 'example/bar' still triggers a preview. Requires a connected git repository. ```yaml x-uffizzi: ingress: service: foo port: 80 services: foo: image: foo:latest x-uffizzi-continuous_previews: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed: true ``` ```yaml x-uffizzi: ingress: service: foo port: 80 continuous-previews: deploy_preview_when_pull_request_is_opened: true delete_preview_when_pull_request_is_closed : true services: foo: build: context: https://github.com/example/foo#main x-uffizzi-continuous_previews: deploy_preview_when_pull_request_is_opened: false bar: build: context: https://github.com/example/bar#main ``` -------------------------------- ### environment variables example Source: https://docs.uffizzi.com/compose/reference Adds environment variables as an array. Boolean values must be quoted to prevent conversion by the YML parser. ```yaml environment: FOO: bar BAR: 'true' ``` -------------------------------- ### x-uffizzi-auto-deploy-updates example Source: https://docs.uffizzi.com/compose/reference Disables auto-deploy updates for a service. Only supported in Uffizzi CI; external CI providers should use their own event triggers. ```yaml services: foo: build: context: github.com/UffizziCloud/foo#main deploy: x-uffizzi-auto-deploy-updates: false ```