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: 30fetch every artifact it names:
sfp artifacts fetch -p Sprint2-13-11.yaml --npm --scope flxblBy 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 flxblWhere 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 .npmrcThe --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.shContinuing 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-errorFlags
| Flag | Description | Required |
|---|---|---|
-p, --releasedefinition | Release definition naming the artifacts to fetch | One of -p / -a |
-a, --artifacts | Comma-separated artifact names, optionally name:version | One of -p / -a |
-d, --artifactdir | Directory to write artifacts to (default artifacts) | Yes |
--npm | Fetch from an npm-compatible registry. Excludes --scriptpath | No |
--scope | Scope the artifacts were published under | With --npm |
--npmrcpath | Path to the .npmrc used to authenticate. Requires --npm | No |
-f, --scriptpath | Script that fetches each artifact. Excludes --npm | No |
--continue-on-error | Keep going when an artifact fails to fetch | No |
Related
- Publish Artifact — publishing the artifacts this command retrieves
- Installing an artifact — installing what you fetched