### Test CF CLI Installation Source: https://github.com/cloudfoundry/bosh-package-cf-cli-release/blob/main/README.md Run this script to test the installation of the CF CLI binary via BOSH job co-location. This command creates a deployment using your currently targeted BOSH Director. ```shell ./tests/run.sh ``` -------------------------------- ### Package Compilation Script Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt Extract and install the CF CLI binary during the BOSH compilation phase. ```bash #!/bin/bash set -exu # Extract the CF CLI tarball tar xzf cf8-cli_8.*_linux_x86-64.tgz # Create bin directory and install cf binary mkdir ${BOSH_INSTALL_TARGET}/bin cp ./cf8 ${BOSH_INSTALL_TARGET}/bin/cf ``` -------------------------------- ### Run Make Target Source: https://github.com/cloudfoundry/bosh-package-cf-cli-release/blob/main/README.md Execute the 'run' make target to start the development environment. This command is used after setting up development variables and secrets. ```shell make run ``` -------------------------------- ### Triggering GitHub Actions Workflow via CLI and API Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt These examples demonstrate how to manually trigger the 'Create Bosh Release' GitHub Actions workflow using the GitHub CLI and the GitHub API. Both methods allow specifying the version bump type. ```bash # Trigger workflow via GitHub CLI gh workflow run create-bosh-release.yml \ --field version_bump_type=minor # Or trigger via API curl -X POST \ -H "Authorization: token $GITHUB_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/cloudfoundry/bosh-package-cf-cli-release/actions/workflows/create-bosh-release.yml/dispatches \ -d '{"ref":"main","inputs":{"version_bump_type":"minor"}}' ``` -------------------------------- ### Generate API Token Source: https://github.com/cloudfoundry/bosh-package-cf-cli-release/blob/main/README.md Use this command to generate an API token for local workflow development. Ensure you have the 'jq' utility installed. ```shell echo "API_TOKEN: $(shepherd create service-account gha-shepherd --json | jq -r .secret)" >> .secrets ``` -------------------------------- ### Download CF CLI Binaries Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt Fetch official CF CLI binaries using the provided download script. ```bash # Download CF CLI v8 binary to a specific directory ./ci/scripts/download-cf-cli-binary.sh \ --major-version 8 \ --output-dir ./build/cf-cli-binaries # The script downloads from: # https://packages.cloudfoundry.org/stable?release=linux64-binary&version=v8&source=bosh-package-cf-cli-release-workflow # Output structure: # ./build/cf-cli-binaries/ # └── 8/ # └── cf8-cli_8.18.0_linux_x86-64.tgz ``` -------------------------------- ### Configure Blobstore Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt Set up S3 blobstore credentials and configuration for release artifacts. ```yaml # config/final.yml name: cf-cli blobstore: provider: s3 options: region: us-west-1 bucket_name: cf-cli-bosh-release endpoint: http://s3-us-west-1.amazonaws.com ``` ```yaml # config/private.yml (not committed to git) blobstore: options: access_key_id: "YOUR_AWS_ACCESS_KEY" assume_role_arn: "arn:aws:iam::ACCOUNT:role/ROLE" secret_access_key: "YOUR_AWS_SECRET_KEY" ``` -------------------------------- ### Local Development with Act for BOSH Release Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt These make commands facilitate local development and testing of the BOSH release by running GitHub Actions workflows. They cover setting up authentication, running specific workflows, and connecting to the BOSH environment. ```bash # Set up GitHub authentication export GITHUB_TOKEN=$(gh auth token) export GITHUB_USER=$(gh api user | jq -r '.login') # Run the create-bosh-release workflow locally make run # Or run individual workflows make create-bosh-release make ensure-ci-image make lint # Connect to the BOSH environment make bosh # Hijack the act runner for debugging make hijack-act ``` -------------------------------- ### Create BOSH Release Candidate Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt Generate a development BOSH release after updating CLI binaries. ```bash # Create release candidate with new binaries ./ci/scripts/create-bosh-release-candidate.sh \ --downloaded-binaries-dir ./build/cf-cli-binaries \ --git-username "github-actions[bot]" \ --git-email "github-actions[bot]@users.noreply.github.com" # This script: # 1. Compares downloaded binaries against current blobs (by SHA256 digest) # 2. Removes outdated blobs and adds new ones # 3. Creates git commits for each blob change # 4. Creates a dev release tarball: ./cf-cli-dev-release.tgz # Output includes: # blobs_updated=true # Set in GITHUB_OUTPUT if changes were made ``` -------------------------------- ### Script for Running CF CLI BOSH Release Tests Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt This bash script automates the deployment, testing, and cleanup of the CF CLI BOSH release. It sets up BOSH environment variables, deploys the test manifest, runs the test errand, and cleans up the deployment. ```bash #!/bin/bash set -e export BOSH_DEPLOYMENT=cf-cli-test export BOSH_NON_INTERACTIVE=true # Delete any previous deployment bosh delete-deployment --force # Deploy the test manifest bosh deploy ./manifests/test.yml # Run the test errand (verifies cf -v works) bosh run-errand cf-cli-8-linux-test # Clean up bosh delete-deployment bosh clean-up --all ``` -------------------------------- ### Creating a Final BOSH Release for CF CLI Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt This script sequence is used to create a final, versioned BOSH release for the CF CLI. It includes uploading blobs, creating the release tarball, and committing/tagging the release in Git. ```bash # Upload blobs to S3 blobstore bosh upload-blobs # Create final release with specific version bosh create-release \ --force \ --final \ --version="2.7.0" \ --tarball="./cf-cli-v2.7.0.tgz" # Commit and tag the release git add .final_builds/packages/cf-cli-8-linux/index.yml releases git commit --message "create final release 2.7.0" git tag v2.7.0 git push origin main --tags ``` -------------------------------- ### Access CF CLI Binary in BOSH Jobs Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt Export the binary path in your BOSH job scripts to enable the cf command. ```bash #!/usr/bin/env bash set -e # Add CF CLI to PATH export PATH=/var/vcap/packages/cf-cli-8-linux/bin:$PATH # Verify CF CLI is available cf -v # Output: cf version 8.x.x+... # Use CF CLI commands cf api https://api.example.com cf auth "$CF_USERNAME" "$CF_PASSWORD" cf target -o my-org -s my-space cf push my-app ``` -------------------------------- ### Configure Blobs Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt Track CF CLI binary artifacts in the blobs.yml file. ```yaml # config/blobs.yml cf8-cli_8.18.0_linux_x86-64.tgz: size: 9588684 sha: sha256:d7f5f24eea21cd5d585b8504005ead5a67a2e6e3edddd5b51a3d1e70f595ba46 ``` -------------------------------- ### Add CF CLI to PATH Source: https://github.com/cloudfoundry/bosh-package-cf-cli-release/blob/main/README.md Modify your BOSH job script to add the CF CLI binary to your PATH. The binary is located at /var/vcap/packages/cf-cli-8-linux/bin/cf. ```shell # Example: Add cf to PATH in your job script export PATH="/var/vcap/packages/cf-cli-8-linux/bin/:$PATH" ``` -------------------------------- ### Copy Variables and Secrets Source: https://github.com/cloudfoundry/bosh-package-cf-cli-release/blob/main/README.md Copy local .vars and .secrets files to the root of the project. This is a preparatory step before potentially overwriting remote values. ```shell cp .github/.vars .github/.secrets . ``` -------------------------------- ### Upload Variables and Secrets Source: https://github.com/cloudfoundry/bosh-package-cf-cli-release/blob/main/README.md Use this command to upload local variables and secrets to the default remote repository for the current branch. Proceed with caution as this will overwrite remote values. ```shell make repo-context-setup ``` -------------------------------- ### Include CF CLI in Deployment Manifest Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt Add the cf-cli release and co-locate the cf-cli-8-linux job within your deployment manifest. ```yaml --- name: my-deployment releases: - name: cf-cli version: latest stemcells: - alias: default os: ubuntu-jammy version: latest instance_groups: - name: my-app azs: [z1] instances: 1 jobs: - name: cf-cli-8-linux release: cf-cli properties: {} vm_type: minimal stemcell: default networks: - name: default ``` -------------------------------- ### Managing GitHub Repository Variables and Secrets Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt This set of bash commands manages GitHub repository variables and secrets for CI/CD pipelines. It includes commands to set variables and secrets from files, list them, and clean them up. ```bash # Set up repository variables from .vars file gh variable set -f .vars --repo cloudfoundry/bosh-package-cf-cli-release # Set up repository secrets from .secrets file gh secret set -f .secrets --repo cloudfoundry/bosh-package-cf-cli-release # List current variables and secrets gh variable list --repo cloudfoundry/bosh-package-cf-cli-release gh secret list --repo cloudfoundry/bosh-package-cf-cli-release # Clean up all variables and secrets make repo-context-cleanup ``` -------------------------------- ### Test Deployment Manifest for CF CLI BOSH Release Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt This YAML manifest is used to deploy and test the CF CLI release in a BOSH environment. It defines the release, stemcell, and instance groups, including the necessary jobs for testing. ```yaml --- name: cf-cli-test releases: - name: cf-cli version: create url: file://. stemcells: - alias: default os: ubuntu-jammy version: latest update: canaries: 2 max_in_flight: 1 canary_watch_time: 5000-60000 update_watch_time: 5000-60000 instance_groups: - name: cf-cli-8-linux lifecycle: errand azs: [z1] instances: 1 jobs: - name: cf-cli-8-linux release: cf-cli properties: {} - name: cf-cli-8-linux-test release: cf-cli properties: {} vm_type: minimal stemcell: default networks: - name: default ``` -------------------------------- ### Define BOSH Package Specification Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt Identify the CF CLI tarball blob in the package specification. ```yaml --- name: cf-cli-8-linux files: - cf8-cli_8.*_linux_x86-64.tgz ``` -------------------------------- ### Define BOSH Job Specification Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt Specify the package dependency for the cf-cli-8-linux job. ```yaml --- name: cf-cli-8-linux templates: {} packages: - cf-cli-8-linux properties: {} ``` -------------------------------- ### GitHub Actions Workflow Trigger Configuration Source: https://context7.com/cloudfoundry/bosh-package-cf-cli-release/llms.txt This YAML defines a GitHub Actions workflow that can be triggered manually. It includes an input for specifying the version bump type (patch, minor, major) for creating new releases. ```yaml # Workflow trigger via GitHub UI or CLI name: Create Bosh Release on: workflow_dispatch: inputs: version_bump_type: type: choice default: minor description: Version bump type options: - patch # 2.7.0 -> 2.7.1 - minor # 2.7.0 -> 2.8.0 - major # 2.7.0 -> 3.0.0 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.