Skip to content

Generate

The generate command scans content under an Artifactory repository path and writes vSphere content library metadata (lib.json, items.json, and per-item item.json).

It does not upload OVF/OVA/ISO binaries. Place content in Artifactory first using the content layout rules (one item per leaf folder under --path).

CLI Example

Refer to generate command options for the full flag list.

artifactory-content-library generate \
  --url "https://packages.example.com/artifactory" \
  --api-key "api-key" \
  --ssl-verify true \
  --name "artifactory-library" \
  --repo "example-repository" \
  --path "example-path"

Environment Variables

Refer to Artifactory environment variables for the full list.

export ARTIFACTORY_URL="https://packages.example.com/artifactory"
export ARTIFACTORY_API_KEY="api-key"
export ARTIFACTORY_SSL_VERIFY="true"

artifactory-content-library generate \
  --name "artifactory-library" \
  --repo "example-repository" \
  --path "example-path"

Configuration File

Refer to init command options for the full flag list.

Generate an example Artifactory configuration:

artifactory-content-library init --type artifactory --output config.yaml

Example:

# yaml-language-server: $schema=https://raw.githubusercontent.com/tenthirtyam/artifactory-content-library/main/schema/config.schema.json
---
libraries:
  - name: example
    type: artifactory
    path: path/to/content
    artifactory:
      url: https://packages.example.com/artifactory
      repo: example
      ssl_verify: true
      rate_limit: 10
      timeout_seconds: 30
      max_retries: 3
      auth:
        # Use Basic Authentication:
        # username: ${ARTIFACTORY_USERNAME}
        # password: ${ARTIFACTORY_PASSWORD}
        # Or Use API Key:
        # api_key: ${ARTIFACTORY_API_KEY}
        # Or Use Access Token:
        # token: ${ARTIFACTORY_TOKEN}

logging:
  format: standard
  level: info
artifactory-content-library generate --config config.yaml

Use exactly one Artifactory authentication method (api_key, username/password, or token). Prefer ${ENV} references for secrets.

Incremental Updates

On re-run, generate:

  • Reuses existing library and item IDs when metadata already exists (matched by storage path / SelfHref).
  • Bumps item and library versions when file names or checksums (SHA1, falling back to MD5) change.
  • Removes orphaned item.json entries for folders that disappeared.
  • Reports the content library as up to date when nothing changed.