### Get Init Command Help Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/cli.md Displays help information for the `init` command, including its description, examples, and compatible flags. ```bash score-k8s init --help ``` -------------------------------- ### Install provisioners via CLI Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/resources-provisioners.md Use the --provisioners flag with the init command to download and install provisioner files. Files installed later take precedence over those installed earlier. ```bash score-k8s init --provisioners https://example.com/provisioner-A.yaml --provisionerss https://example.com/provisioner-B.yaml ``` -------------------------------- ### Install provisioners via CLI Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/resources-provisioners.md Use the --provisioners flag with the init command to download and install provisioner files from a URL. Files installed later take precedence over earlier ones. ```bash score-compose init --provisioners https://example.com/provisioner-A.yaml --provisionerss https://example.com/provisioner-B.yaml ``` -------------------------------- ### Example `template://` Provisioner Configuration Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/resources-provisioners.md This example demonstrates a `template://` provisioner configuration, including `init` and `state` templates. The `init` template sets initial values, and the `state` template manages resource state across provision attempts. ```yaml - uri: template://example-provisioners/example-provisioner # (Required) Which resource type to match type: example-provisioner-resource description: Example provisioner that runs a template. # (Optional) Which 'class' of the resource. Null will match any class, a non-empty value like 'default' will match # only resources of that class. class: null # (Optional) The exact resource id to match. Null will match any resource, a non-empty value will only match # the resource with exact same id. id: null # (Optional) The init template sets the initial context values on each provision request. This is a text template # that must evaluate to a YAML/JSON key-value map. init: | key: value # sprig functions are also supported key2: {{ print "value" | upper }} # other attributes are available such as Type, Class, Id, Uid, Guid. my-uid: "{{ .Uid }}#{{ .Guid }}" # (Optional) The state template gets evaluated next and sets the internal state of this resource based on the previous # state and the init context. Like init, this evaluates to a YAML/JSON object. This is the template that allows # state to be stored between each generate call. state: | stateKey: {{ .Init.key }} # will copy the value from init stateKey2: {{ default 0 .State.stateKey2 | add 1 }} # will increment on each provision attempt # (Optional) The shared state template is like state, but is a key-value structure shared between all resources. ``` -------------------------------- ### Get Generate Command Help Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/cli.md Displays help information for the `generate` command, including its description, examples, and compatible flags. ```bash score-k8s generate --help ``` -------------------------------- ### Complete Score GitHub Actions Workflow Example Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/github.md A full example workflow that installs the latest version of `score-compose`, adds it to PATH, and verifies the installation. The action caches the Score binary to avoid re-downloading. ```yaml name: Score Example on: push jobs: test: runs-on: ubuntu-latest steps: - uses: score-spec/setup-score@v3 with: file: score-compose version: 'latest' token: ${{ secrets.GITHUB_TOKEN }} - run: score-compose --version ``` -------------------------------- ### Install bash-completion Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/included/optional-score-configs-bash-mac.md Install the bash-completion package via Homebrew as a prerequisite. ```bash brew install bash-completion ``` -------------------------------- ### Install and run score-compose Source: https://context7.com/score-spec/docs/llms.txt Commands for installing the score-compose CLI and executing it via Docker or local installation. ```bash # Install via Homebrew (macOS/Linux) brew install score-spec/tap/score-compose # Install via Go go install -v github.com/score-spec/score-compose/cmd/score-compose@latest # Run via Docker docker run --rm -it ghcr.io/score-spec/score-compose:latest --help # Run with volume mount for local files docker run --rm -it -v .:/score-compose ghcr.io/score-spec/score-compose:latest init # Verify installation score-compose --version ``` -------------------------------- ### Example: Source score-compose completion script Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/included/optional-score-configs-zsh.md An example of sourcing the completion script for score-compose. ```bash source <(score-compose completion zsh) ``` -------------------------------- ### Install dependencies with Yarn Source: https://github.com/score-spec/docs/blob/main/README.md Install all required packages for the documentation project. ```bash yarn install ``` -------------------------------- ### Install score-compose via Go Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/installation.md Requires Go to be installed on the system. ```bash go install -v github.com/score-spec/score-compose/cmd/score-compose@latest ``` -------------------------------- ### Define custom resource provisioners Source: https://context7.com/score-spec/docs/llms.txt Examples of template-based and command-based resource provisioner configurations. ```yaml # Custom provisioner example: .score-compose/01-custom.provisioners.yaml - uri: template://custom/my-database type: my-database class: default description: Provisions a custom database container init: | name: db-{{ .Uid | replace "." "-" }} port: 5432 state: | service: {{ .Init.name }} password: {{ default (randAlphaNum 16) .State.password }} outputs: | host: {{ .State.service }} port: {{ .Init.port }} username: admin password: {{ .State.password }} database: mydb services: | {{ .State.service }}: image: postgres:15-alpine environment: POSTGRES_USER: admin POSTGRES_PASSWORD: {{ .State.password }} POSTGRES_DB: mydb # Command-based provisioner example - uri: cmd://python#my-provisioner type: custom-resource class: default args: ["-c", "import json,sys; print(json.dumps({'resource_outputs':{'key':'value'}}))"] expected_outputs: - key ``` -------------------------------- ### Example wget output Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/included/install-wget-k8s.md This is an example of the output you might see when downloading the release file using wget. ```bash Saving to: score-k8s__.tar.gz score-k8s_ 100%[===================>] 2.85M 5.28MB/s in 0.5s ``` -------------------------------- ### Install score-k8s via Go Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/installation.md Requires Go to be installed on the system. ```bash $ go install -v github.com/score-spec/score-k8s/cmd/score-k8s@latest ``` -------------------------------- ### Configure a Python inline script provisioner Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/resources-provisioners.md Example of using the cmd:// provisioner with the python binary and inline arguments. ```yaml - uri: "cmd://python" args: ["-c", "print({\"resource_outputs\":{}})"] ``` -------------------------------- ### Install and run score-k8s Source: https://context7.com/score-spec/docs/llms.txt Commands for installing the score-k8s CLI and executing it via Docker or local installation. ```bash # Install via Homebrew (macOS/Linux) brew install score-spec/tap/score-k8s # Install via Go go install -v github.com/score-spec/score-k8s/cmd/score-k8s@latest # Run via Docker docker run --rm -it ghcr.io/score-spec/score-k8s:latest --help # Run with volume mount for local files docker run --rm -it -v .:/score-k8s ghcr.io/score-spec/score-k8s:latest init # Verify installation score-k8s --version ``` -------------------------------- ### Install Bash Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/included/optional-score-configs-bash-mac.md Install the latest version of Bash using Homebrew. ```bash brew install bash ``` -------------------------------- ### Install Score tools script Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/dev-containers.md Automates the installation of score-compose, score-k8s, and kind within the container environment. ```bash #!/bin/bash mkdir install-more-tools cd install-more-tools SCORE_COMPOSE_VERSION=$(curl -sL https://api.github.com/repos/score-spec/score-compose/releases/latest | jq -r .tag_name) wget https://github.com/score-spec/score-compose/releases/download/${SCORE_COMPOSE_VERSION}/score-compose_${SCORE_COMPOSE_VERSION}_linux_amd64.tar.gz tar -xvf score-compose_${SCORE_COMPOSE_VERSION}_linux_amd64.tar.gz chmod +x score-compose sudo mv score-compose /usr/local/bin SCORE_K8S_VERSION=$(curl -sL https://api.github.com/repos/score-spec/score-k8s/releases/latest | jq -r .tag_name) wget https://github.com/score-spec/score-k8s/releases/download/${SCORE_K8S_VERSION}/score-k8s_${SCORE_K8S_VERSION}_linux_amd64.tar.gz tar -xvf score-k8s_${SCORE_K8S_VERSION}_linux_amd64.tar.gz chmod +x score-k8s sudo mv score-k8s /usr/local/bin KIND_VERSION=$(curl -sL https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r .tag_name) curl -Lo ./kind https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64 chmod +x ./kind sudo mv ./kind /usr/local/bin/kind cd .. rm -rf install-more-tools ``` -------------------------------- ### Setup Kind Cluster Script Source: https://github.com/score-spec/docs/blob/main/gen/external-content/resource-provisioners/community/redis/score-k8s/README.md Use this script to deploy a local Kind cluster if one is not already available. ```bash .scripts/setup-kind-cluster.sh ``` -------------------------------- ### Run documentation server locally Source: https://github.com/score-spec/docs/blob/main/README.md Start the Hugo server to view the site at http://localhost:1313. ```bash yarn build OR yarn run hugo server ``` -------------------------------- ### Install Nginx Ingress controller Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/score-k8s/kind-cluster.md Deploys the standard Nginx Ingress controller for Kind. ```bash kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml ``` -------------------------------- ### Install score-compose via Homebrew Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/installation.md Requires Homebrew to be installed on the system. ```bash brew install score-spec/tap/score-compose ``` -------------------------------- ### Example Score file with resource Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score specification/score-spec-reference.md A sample Score file demonstrating a workload with a database resource reference. ```yaml apiVersion: score.dev/v1b1 metadata: name: backend containers: container-id: image: busybox command: ["/bin/sh"] args: ["-c", "while true; do echo Hello $${FRIEND}!; sleep 5; done"] variables: CONNECTION_STRING: postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.name} resources: db: type: postgres ``` -------------------------------- ### dprint Formatting Example Output Source: https://github.com/score-spec/docs/blob/main/styles/style-guide.md This is an example of the output you might see after running the dprint formatting command. ```bash $ dprint fmt Formatted 1 file. ✨ Done in 0.13s. ``` -------------------------------- ### Verify score-compose Installation Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/included/install-score-compose-bash.md Run this command to verify that score-compose has been installed correctly and is accessible in your PATH. ```bash score-compose --version ``` -------------------------------- ### Example: Enable Score Compose Auto-completion Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/included/optional-score-configs-pwsh.md An example of enabling auto-completion for the `score-compose` CLI by sourcing the completion script dynamically. ```bash score-compose completion powershell | Out-String | Invoke-Expression ``` -------------------------------- ### Lint documentation with Vale Source: https://github.com/score-spec/docs/blob/main/README.md Check documentation files against style guides using Vale. ```bash vale sync vale styles/style-guide.md ``` ```bash styles/style-guide.md 40:71 error Did you really mean Vale.Spelling 'inclusivity'? ✖ 1 error, 0 warnings and 0 suggestions in 1 file. ``` ```bash yarn lint ``` -------------------------------- ### Clean Up Installation Files Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/included/install-score-k8s-curl-mac.md Remove the downloaded tarball and any extracted documentation files after successful installation. ```bash rm score-k8s.tgz README.md LICENSE ``` -------------------------------- ### Generate example hub pages Source: https://github.com/score-spec/docs/blob/main/README.md Execute the generation script to create pages from integrated external content. ```bash yarn gen-example-pages ``` -------------------------------- ### Install Nginx Gateway Fabric Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/score-k8s/kind-cluster.md Deploys the Nginx Gateway API implementation using Helm. ```bash helm upgrade ngf oci://ghcr.io/nginxinc/charts/nginx-gateway-fabric \ --install \ --create-namespace \ -n nginx-gateway \ --set service.type=NodePort \ --set-json 'service.ports=[{"port":80,"nodePort":31000}]' ``` -------------------------------- ### Score Workload Definition Example Source: https://github.com/score-spec/docs/blob/main/content/en/docs/overview/_index.md This example demonstrates a basic Score file for a web server that depends on a PostgreSQL database. It shows how to define the API version, metadata, and container configurations, including environment variables that reference resources. ```yaml apiVersion: score.dev/v1b1 metadata: name: sample # A set of containers deployed together for this Workload. containers: main: # The image for our service. When deploying, this will be overriden with a particular container image. image: . variables: # Pass the resource outputs to our container as environment variables. The Score implementation takes care of securing any secret access as needed. PG_CONNECTION_STRING: "postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.database}?sslmode=disable" ``` -------------------------------- ### Initialize score-compose Workspace Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/frontend-and-backend-score-compose.md Initializes a `score-compose` workspace, including service and DNS provisioners. Ensure you have installed `score-compose` first. ```bash score-compose init --no-sample \ --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/service/score-compose/10-service.provisioners.yaml \ --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/dns/score-compose/10-dns-with-url.provisioners.yaml ``` -------------------------------- ### JSON patch path examples Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/patch-templates.md Examples of dot-separated JSON paths used for targeting specific fields in the generated manifests. ```yaml services.some\.thing # patches the some.thing service services.foo.ports.0 # modifies the first item in the ports array services.foo.ports.-1 # adds to the end of the ports array something.:0000.xyz # patches the xyz item in the "0000" item of something (: escapes a numeric index) ``` -------------------------------- ### Execute Bash Script Provisioner with Secrets Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/resources-provisioners.md This example demonstrates using a 'cmd://bash' provisioner to run a bash script that outputs both regular and sensitive data, including a secret reference. ```yaml - uri: cmd://bash#example-provisioner type: example-provisioner-resource description: Example provisioner that runs a bash script. class: default id: specific args: ["-c", "echo '{\"resource_outputs\":{\"key\":\"value\",\"secret\":\"🔐💬mysecret_mykey💬🔐\"},\"manifests\":[]}'"] expected_outputs: - key - secret ``` -------------------------------- ### Define Service Ports Example Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score specification/score-spec-reference.md Demonstrates how to expose multiple public ports and map them to internal container ports. ```yaml apiVersion: score.dev/v1b1 metadata: name: web-app service: ports: www: port: 80 targetPort: 8080 admin: port: 8080 protocol: UDP # . . . ``` -------------------------------- ### Initialize with Provisioners and No Default Provisioner Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/cli.md Loads additional provisioners and skips the creation of the default provisioners file. ```bash score-k8s init --provisioners https://raw.githubusercontent.com/user/repo/main/example.yaml --no-default-provisioners ``` -------------------------------- ### Execute Python Inline Script Provisioner Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/resources-provisioners.md Use the 'cmd://python' provisioner URI to execute Python scripts. This example shows a basic provisioner that prints empty resource outputs. ```yaml - uri: "cmd://python" args: ["-c", "print({\"resource_outputs\":{}})"] ``` -------------------------------- ### Run documentation with score-compose Source: https://github.com/score-spec/docs/blob/main/README.md Initialize and run the documentation site as a containerized service. ```bash score-compose init --no-sample score-compose generate score.yaml --build main=. docker compose up --build -d curl $(score-compose resources get-outputs dns.default#score-docs.dns --format '{{ .host }}:8080/docs/') ``` -------------------------------- ### Check Application Logs Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/dapr-score-k8s.md View the logs of the running container to confirm that the application has started successfully and is listening on the expected port. ```none Node App listening on port 3000! ``` -------------------------------- ### Verify score-k8s Installation Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/included/install-score-k8s-bash.md Verify the installation by checking the score-k8s version. This command should output the installed version number. ```bash score-k8s --version ``` -------------------------------- ### List provisioners with format Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Lists provisioners using a specific output format. ```bash score-compose provisioners list --format json ``` -------------------------------- ### Initialize score-compose project Source: https://context7.com/score-spec/docs/llms.txt Use the init command to set up the working directory with default provisioners and configuration files. ```bash # Initialize with sample score.yaml score-compose init # Initialize without sample file (when you already have a score.yaml) score-compose init --no-sample # Initialize with custom project name score-compose init --project my-project # Initialize with custom provisioners from URL score-compose init --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/main/dapr-pubsub/score-compose/00-dapr-pubsub.provisioners.yaml # Initialize with remote patch templates score-compose init --patch-templates https://example.com/patches.yaml # Skip default provisioners when using custom ones score-compose init --provisioners https://example.com/custom.yaml --no-default-provisioners ``` -------------------------------- ### Test Application Endpoint Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/dapr-score-compose.md Send a request to your application's endpoint to verify it's running. This example tests the DNS routing. ```bash curl localhost:8080 -H "Host: dnsbcsqnd.localhost" ``` -------------------------------- ### Install score-k8s via Homebrew Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/installation.md Requires Homebrew to be installed on the system. ```bash brew install score-spec/tap/score-k8s ``` -------------------------------- ### Initialize score-k8s environment Source: https://context7.com/score-spec/docs/llms.txt Prepares the directory for score-k8s by creating the .score-k8s/ subdirectory and configuring provisioners. ```bash # Initialize with sample score.yaml score-k8s init # Initialize without sample file score-k8s init --no-sample # Initialize with custom provisioners score-k8s init --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/main/redis/score-k8s/00-redis-bitnami-helm.provisioners.yaml # Initialize with patch templates score-k8s init --patch-templates https://example.com/k8s-patches.yaml # Skip default provisioners score-k8s init --provisioners https://example.com/custom.yaml --no-default-provisioners ``` -------------------------------- ### List provisioners Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Lists all available provisioners. ```bash score-compose provisioners list [flags] ``` -------------------------------- ### Run with env-file flag Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Specifies the location to store the sample .env file. ```bash score-compose run -f ./score.yaml -o ./compose.yaml --env-file ./backend.env ``` -------------------------------- ### Initialize score-compose project Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md The init command sets up the local environment. It creates a score.yaml file and a .score-compose/ directory. ```bash score-compose init [flags] ``` ```bash score-compose init --file custom_file_name.yaml ``` ```bash score-compose init --no-sample ``` ```bash score-compose init --project score-compose2 ``` ```bash score-compose init --provisioners https://raw.githubusercontent.com/user/repo/main/example.yaml ``` ```bash score-compose init --provisioners https://raw.githubusercontent.com/user/repo/main/example.yaml --no-default-provisioners ``` ```bash score-compose init --patch-templates https://raw.githubusercontent.com/user/repo/main/example.yaml ``` ```bash score-compose init --help ``` -------------------------------- ### Example Patch Template for Security Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/patch-templates.md This Golang text/template injects security settings like read-only filesystem, user ID, and capability drops for each workload container. It iterates through workloads and their containers, applying specific JSON patches. ```go-template {{ range $name, $spec := .Workloads }} {{ range $cname, $_ := $spec.containers }} - op: set path: services.{{ $name }}-{{ $cname }}.read_only value: true - op: set path: services.{{ $name }}-{{ $cname }}.user value: "65532" - op: set path: services.{{ $name }}-{{ $cname }}.cap_drop value: ["ALL"] {{ end }} {{ end }} ``` -------------------------------- ### Manage provisioners and resources Source: https://context7.com/score-spec/docs/llms.txt Commands to list available provisioners, provisioned resources, and retrieve resource outputs. ```bash # List available provisioners score-compose provisioners list score-compose provisioners list --format json # List provisioned resources score-compose resources list score-compose resources list --format json # Get resource outputs score-compose resources get-outputs score-compose resources get-outputs dns.default#my-workload.dns --format '{{ .host }}' ``` -------------------------------- ### score-k8s Version Output Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/included/install-score-k8s-bash.md The expected output after verifying the installation, showing the installed version of score-k8s. ```bash score-k8s x.y.z ``` -------------------------------- ### Initialize score-compose workspace Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/backstage-score-compose.md Sets up the .score-compose directory with default and external DNS provisioners. ```bash score-compose init --no-sample \ --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/dns/score-compose/10-dns-with-url.provisioners.yaml ``` -------------------------------- ### Initialize score-k8s Project Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/cli.md Prepares the current directory for score-k8s by creating a '.score-k8s' subdirectory for state and default provisioners. This directory should not be checked into generic source control. ```bash score-k8s init [flags] ``` -------------------------------- ### Initialize score-k8s with Dns Provisioner Source: https://github.com/score-spec/docs/blob/main/content/en/examples/score/resources/community-provisioners/dns.md Use this command to initialize your local workspace with a specific Dns provisioner file for score-k8s. Replace the placeholder with the actual provisioner file URL. ```bash score-k8s init --provisioners REPLACE-ME-WITH-ACTUAL-PROVISIONER-FILE-URL.yaml ``` -------------------------------- ### Vale Linting Example Output Source: https://github.com/score-spec/docs/blob/main/styles/style-guide.md This is an example of the output from Vale linting, indicating a spelling error. ```bash styles/style-guide.md 40:71 error Did you really mean Vale.Spelling 'inclusivity'? ✖ 1 error, 0 warnings and 0 suggestions in 1 file. ``` -------------------------------- ### Install Gateway API CRDs Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/score-k8s/kind-cluster.md Fetches and applies the latest Gateway API standard installation manifests. ```bash GATEWAY_API_VERSION=$(curl -sL https://api.github.com/repos/kubernetes-sigs/gateway-api/releases/latest | jq -r .tag_name) kubectl apply \ -f https://github.com/kubernetes-sigs/gateway-api/releases/download/${GATEWAY_API_VERSION}/standard-install.yaml ``` -------------------------------- ### Display general help Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Provides information on all available commands. ```bash score-compose help [command] [flags] ``` -------------------------------- ### Initialize score-compose with Dns Provisioner Source: https://github.com/score-spec/docs/blob/main/content/en/examples/score/resources/community-provisioners/dns.md Use this command to initialize your local workspace with a specific Dns provisioner file for score-compose. Replace the placeholder with the actual provisioner file URL. ```bash score-compose init --provisioners REPLACE-ME-WITH-ACTUAL-PROVISIONER-FILE-URL.yaml ``` -------------------------------- ### CLI Command: init Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Initializes a score-compose project by creating a score.yaml file and a .score-compose/ working directory. ```APIDOC ## CLI Command: init ### Description The init command creates a basic `score.yaml` file in the current directory and initializes a `.score-compose/` working directory if it doesn't already exist. ### Usage `score-compose init [flags]` ### Flags - **--file** | **-f** (string) - Optional - Specifies a Score file to initialize. Default: `./score.yaml`. - **--no-sample** (boolean) - Optional - Disables the generation of the sample Score file. - **--project** | **-p** (string) - Optional - Sets the name of the Docker Compose project. - **--provisioners** (string) - Optional - Loads additional provisioners from a remote URL. May be specified multiple times. - **--no-default-provisioner** (boolean) - Optional - Skip default provisioners file creation. - **--patch-templates** (string) - Optional - Loads patch templates from a remote URL. May be specified multiple times. - **--help** | **-h** (boolean) - Optional - Displays help information. ``` -------------------------------- ### Example tar extraction output Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/included/install-wget-k8s.md This is an example of the output you might see after successfully extracting the tar.gz archive. ```bash x LICENSE x README.md x score-k8s ``` -------------------------------- ### Display provisioners help Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Shows help information for the provisioners command. ```bash score-compose provisioners --help ``` -------------------------------- ### Workload Example Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score specification/score-spec-reference.md A top-level example of a workload definition in Score Specification format. It includes the API version, workload name, and placeholders for container, service, and resource definitions. ```yaml apiVersion: score.dev/v1b1 metadata: name: hello-world annotations: example.com/my-annotation: value containers: my-container: # . . . service: ports: # . . . resources: env: # . . . ``` -------------------------------- ### List resources with format Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Lists resources using a specific output format. ```bash score-compose resources list --format json ``` -------------------------------- ### score-k8s init Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/cli.md Prepares the current directory for working with score-k8s by creating the .score-k8s subdirectory and default configuration files. ```APIDOC ## score-k8s init ### Description Prepares the current directory for working with score-k8s and writes the initial empty state and default provisioners file into the '.score-k8s' subdirectory. ### Command score-k8s init [flags] ### Flags - **--file** | **-f** (string) - Optional - Specifies a Score file to initialize (default: ./score.yaml). - **--no-sample** (boolean) - Optional - Disables the generation of the sample Score file. - **--provisioners** (string) - Optional - Loads additional provisioners from a remote URL. Can be specified multiple times. - **--no-default-provisioner** (boolean) - Optional - Skip default provisioners file creation. - **--patch-templates** (string) - Optional - Loads patch templates from a remote URL. Can be specified multiple times. - **--help** | **-h** (boolean) - Optional - Displays help information. ``` -------------------------------- ### score-compose Version Output Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/included/install-score-compose-bash.md This is the expected output when verifying the score-compose installation. ```bash score-compose x.y.z ``` -------------------------------- ### Get resource outputs Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/backstage-score-compose.md Retrieves the output values for a specific resource. ```bash score-compose resources get-outputs dns.default#backstage.dns ``` ```bash score-compose resources get-outputs postgres-instance.default#backstage.pg ``` -------------------------------- ### Clean up installation files Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/included/install-score-compose-curl-mac.md Removes the temporary tarball and documentation files after extraction. ```bash rm score-compose.tgz README.md LICENSE ``` -------------------------------- ### List available provisioners Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/dapr-score-k8s.md Displays the currently configured resource provisioners. ```bash score-k8s provisioners list ``` -------------------------------- ### Get resource outputs Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Retrieves the outputs of provisioned resources for use by workloads. ```bash score-compose resources get-outputs ``` -------------------------------- ### Verify Bash version Source: https://github.com/score-spec/docs/blob/main/content/en/docs/How to/included/optional-score-configs-bash-mac.md Check the current Bash version and shell path after installation. ```bash echo $BASH_VERSION $SHELL ``` -------------------------------- ### Initialize External Libraries Source: https://github.com/score-spec/docs/blob/main/layouts/partials/scripts.html Conditional initialization scripts for Mermaid and Markmap based on site parameters. ```html {{ if .Store.Get "hasMermaid" }} import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs'; mermaid.initialize({ startOnLoad: true }); {{ end }} {{ if .Site.Params.markmap.enable }} .markmap > svg { width: 100%; height: 300px; } window.markmap = { autoLoader: { manual: true }, }; {{ end }} ``` -------------------------------- ### Get Resource Outputs with score-compose Source: https://github.com/score-spec/docs/blob/main/content/en/examples/score/resources/default-provisioners/mysql.md Fetch the outputs for each listed resource using score-compose. ```bash score-commpose resources get-outputs ``` -------------------------------- ### Initialize Local Workspace with score-compose Source: https://github.com/score-spec/docs/blob/main/content/en/examples/score/resources/default-provisioners/mysql.md Use this command to initialize your local workspace with default provisioners for score-compose. ```bash score-commpose init ``` -------------------------------- ### Get all resource outputs Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/microservices-score-k8s.md Retrieves all output values for a specified resource in JSON format. ```bash score-k8s resources get-outputs redis.default#cart.redis-cart ``` -------------------------------- ### Get DNS resource output Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/dapr-score-k8s.md Retrieves the host output for the specified DNS resource. ```bash score-k8s resources get-outputs dns.default#nodeapp.dns --format '{{ .host }}' ``` -------------------------------- ### Pull updated external content Source: https://github.com/score-spec/docs/blob/main/README.md Fetch the latest content from the remote example library repositories. ```bash yarn gen-get-external-content ``` -------------------------------- ### Initialize with Additional Provisioners Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/cli.md Loads additional provisioners from a remote URL. Supports http, https, git-ssh, git-https, and oci formats. This flag can be specified multiple times. ```bash score-k8s init --provisioners https://raw.githubusercontent.com/user/repo/main/example.yaml ``` -------------------------------- ### Get resource output Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/nginx-score-k8s.md Fetches specific output values for a given resource, formatted as requested. ```bash score-k8s resources get-outputs dns.default#nginx.dns --format '{{ .host }}' ``` -------------------------------- ### Get resource output details Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/frontend-and-backend-score-k8s.md Retrieves specific output values for a given resource identifier. ```bash score-k8s resources get-outputs dns.default#dns ``` ```bash score-k8s resources get-outputs postgres-instance.default#backend.pg ``` -------------------------------- ### Initialize directory via Docker Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/installation.md Runs the init subcommand to initialize the local working directory. ```bash docker run --rm -it -v .:/score-compose scorespec/score-compose:latest init docker run --rm -it -v .:/score-compose ghcr.io/score-spec/score-compose:latest init ``` -------------------------------- ### Initialize Local Workspace with score-k8s Source: https://github.com/score-spec/docs/blob/main/content/en/examples/score/resources/default-provisioners/mysql.md Use this command to initialize your local workspace with default provisioners for score-k8s. ```bash score-k8s init ``` -------------------------------- ### Security hardening patch template Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/patch-templates.md A template example that injects security context settings into Deployment manifests. ```yaml {{ range $i, $m := .Manifests }} {{ if eq $m.kind "Deployment" }} - op: set path: {{ $i }}.spec.template.spec.automountServiceAccountToken value: false - op: set path: {{ $i }}.spec.template.spec.securityContext value: fsGroup: 65532 runAsGroup: 65532 runAsNonRoot: true runAsUser: 65532 seccompProfile: type: "RuntimeDefault" {{ range $cname, $_ := $m.spec.template.spec.containers }} - op: set path: {{ $i }}.spec.template.spec.containers.{{ $cname }}.securityContext value: allowPrivilegeEscalation: false privileged: false readOnlyRootFilesystem: true capabilities: drop: - ALL {{ end }} {{ end }} {{ end }} ``` -------------------------------- ### Display completion help Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Shows usage details for the completion command. ```bash score-compose completion [command] --help ``` -------------------------------- ### Get Outputs of Provisioned Resources Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/cli.md Retrieves the outputs of provisioned resources. These values can be used by workloads or other processes. ```bash score-k8s resources get-outputs ``` -------------------------------- ### Get specific resource output Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/microservices-score-k8s.md Retrieves a specific output value from a resource using a format string. ```bash score-k8s resources get-outputs dns.default#frontend.dns --format '{{ .host }}' ``` -------------------------------- ### Deploy and inspect with kubectl Source: https://github.com/score-spec/docs/blob/main/gen/external-content/resource-provisioners/community/score-k8s.md Standard kubectl commands for applying generated manifests and viewing container status. ```bash kubectl apply -f manifests.yaml ``` ```bash kubectl get all ``` -------------------------------- ### Get Dapr StateStore resource output Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/dapr-score-k8s.md Retrieves the output details for the specified Dapr StateStore resource. ```bash score-k8s resources get-outputs dapr-state-store.default#nodeapp.state-store ``` -------------------------------- ### Run score-k8s via Docker Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/installation.md Requires Docker to be installed. These commands execute the CLI within a containerized environment. ```bash docker run --rm -it ghcr.io/score-spec/score-k8s:latest ``` ```bash docker run --rm -it ghcr.io/score-spec/score-k8s:latest --help ``` ```bash docker run --rm -it -v .:/score-k8s ghcr.io/score-spec/score-k8s:latest init ``` -------------------------------- ### Display resources help Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Shows help information for the resources command. ```bash score-compose resources --help ``` -------------------------------- ### View score-compose help via Docker Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/installation.md Displays available options for the CLI using the --help flag. ```bash docker run --rm -it scorespec/score-compose:latest --help docker run --rm -it ghcr.io/score-spec/score-compose:latest --help ``` -------------------------------- ### Score Original Specification YAML Source: https://context7.com/score-spec/docs/llms.txt An example Score specification file defining workload metadata, containers, and resources. ```yaml apiVersion: score.dev/v1b1 metadata: name: my-app containers: main: image: myapp:v1 command: - python - app.py variables: DEBUG: "false" resources: limits: memory: "128Mi" ``` -------------------------------- ### Initialize with Custom Score File Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-k8s/cli.md Initializes the score-k8s project using a specified Score file instead of the default './score.yaml'. ```bash score-k8s init --file custom_file_name.yaml ``` -------------------------------- ### Score Override Specification YAML Source: https://context7.com/score-spec/docs/llms.txt An example Score override file used to customize properties of an original Score specification. ```yaml # overrides.score.yaml - Override file containers: main: image: myapp:v2-debug command: - python - -m - debugpy - app.py variables: DEBUG: "true" resources: limits: memory: "256Mi" ``` -------------------------------- ### Display run command help Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/cli.md Shows help output for the run command. ```bash score-compose run -h ``` -------------------------------- ### Deploy and Monitor Containers Source: https://github.com/score-spec/docs/blob/main/gen/external-content/resource-provisioners/community/score-compose.md Commands for deploying generated manifests and viewing container status. ```bash docker compose up -d ``` ```bash docker ps ``` -------------------------------- ### List available resource provisioners Source: https://github.com/score-spec/docs/blob/main/content/en/docs/examples/included/backstage-score-compose.md Displays the currently configured resource provisioners in the workspace. ```bash score-compose provisioners list ``` -------------------------------- ### Run score-compose via Docker Source: https://github.com/score-spec/docs/blob/main/content/en/docs/score implementation/score-compose/installation.md Requires Docker to be installed. Uses official images from Docker Hub or GitHub Container Registry. ```bash docker run --rm -it scorespec/score-compose:latest docker run --rm -it ghcr.io/score-spec/score-compose:latest ```