Fetching Artifacts

sfp artifacts fetch retrieves published artifacts from a registry onto your local file system, where they can be installed or inspected.

Artifacts are written to the directory given by -d/--artifactdir, which defaults to artifacts.

Choosing what to fetch

The command takes either a release definition or an explicit list of artifacts. Passing both, or neither, is an error.

From a release definition

Given a release definition file such as Sprint2-13-11.yaml:

release: Sprint-2-13-11-6844956242
skipIfAlreadyInstalled: true
skipArtifactUpdate: false
artifacts:
  feature-management: 1.0.19-6844956242
promotePackagesBeforeDeploymentToOrg: prod
changelog:
  workItemFilters:
    - (FGK|FFK)-[0-9]{3,4}
  workItemUrl: https://flxbl.atlassian.net/browse
  limit: 30

fetch every artifact it names:

sfp artifacts fetch -p Sprint2-13-11.yaml --npm --scope flxbl

By name

-a/--artifacts takes a comma-separated list, and each entry may pin a version with name:version:

# Latest of each
sfp artifacts fetch -a feature-management,core-crm --npm --scope flxbl

# A specific version
sfp artifacts fetch -a feature-management:1.0.19-6844956242 --npm --scope flxbl

Where artifacts are fetched from

When --sfp-server-url is set, artifacts are fetched from the sfp server's internal registry. If --npm is also passed with a --repository and no --npmrcpath, sfp retrieves the registry .npmrc from the server and falls back to that external registry.

Without a server, fetching is external only, and needs --npm with a --scope, or a --scriptpath.

# Internal registry
sfp artifacts fetch -p release.yaml --sfp-server-url https://sfp.example.com

# External npm registry
sfp artifacts fetch -p release.yaml --npm --scope flxbl --npmrcpath .npmrc

The --scope must match the scope the artifacts were published under.

Fetching from somewhere that is not npm

Where artifacts live in storage that is not an npm registry, pass --scriptpath instead of --npm — the two are mutually exclusive. sfp calls the script once per artifact.

sfp artifacts fetch -p release.yaml -f scripts/fetch-artifact.sh

Continuing past failures

By default a failed artifact fails the command. --continue-on-error processes the remaining artifacts and reports which ones failed, which is useful when auditing what a registry actually holds.

sfp artifacts fetch -p release.yaml --npm --scope flxbl --continue-on-error

Flags

FlagDescriptionRequired
-p, --releasedefinitionRelease definition naming the artifacts to fetchOne of -p / -a
-a, --artifactsComma-separated artifact names, optionally name:versionOne of -p / -a
-d, --artifactdirDirectory to write artifacts to (default artifacts)Yes
--npmFetch from an npm-compatible registry. Excludes --scriptpathNo
--scopeScope the artifacts were published underWith --npm
--npmrcpathPath to the .npmrc used to authenticate. Requires --npmNo
-f, --scriptpathScript that fetches each artifact. Excludes --npmNo
--continue-on-errorKeep going when an artifact fails to fetchNo

On this page