Manage Builds
Append, promote, retain, or delete published Artifactory builds.
Manage Builds covers JFrog Artifactory operations on already published build-info: append, promote, retain, and delete. Use this page after you have completed Inspect Builds and decided the scope of change.
When to Use Each Operation
The following table lists when to use each operation.
| Operation | Use when | Do not use when |
|---|---|---|
| Append | A release build must reference already-published upstream builds | The source build was never published |
| Promote | You need this build's artifacts copied or moved to another repository, with optional status | You need Release Lifecycle Management workflows. Those are a separate product path |
| Discard or retention | You need to drop old build records by age or count | You have not reviewed whether artifacts should also be deleted |
| Delete build information | You need to remove records without assuming artifact deletion | You inferred artifact removal from a label alone |
Build promotion in Artifactory is not the same as JFrog Release Lifecycle Management (RLM). This page documents jf rt build-promote and equivalent build API promotion. See RLM documentation for that product. Don't treat promotion as a substitute for a full release train.
Before You Begin
- Publish the build and verify it in Inspect Builds.
- Configure JFrog CLI with access to Artifactory when using CLI commands.
- Obtain read access to source build content and the permissions required by the target operation.
- For promotion, confirm the target repository and whether artifacts should move or be copied.
- For retention or deletion, decide whether underlying artifacts must remain.
Append a Published Build
Append an already-published build when a release build needs to reference one or more upstream builds.
To append a published build:
-
Run the following command. The current build comes first. The published build being appended comes second.
jf rt build-append <BUILD_NAME> <BUILD_NUMBER> <BUILD_NAME_TO_APPEND> <BUILD_NUMBER_TO_APPEND>Where:
<BUILD_NAME>: The name of the current build.<BUILD_NUMBER>: The number of the current build.<BUILD_NAME_TO_APPEND>: The name of the published build to append.<BUILD_NUMBER_TO_APPEND>: The number of the published build to append.
For example:
jf rt build-append release-build 1 upstream-build 3 -
Publish the aggregate build after appending its inputs.
Promote a Build
Promote a published build to a target repository.
To promote a published build:
-
Run the following command.
jf rt build-promote <BUILD_NAME> <BUILD_NUMBER> <TARGET_REPOSITORY>Where:
<BUILD_NAME>: The name of the published build to promote.<BUILD_NUMBER>: The number of the published build to promote.<TARGET_REPOSITORY>: The repository that receives the promoted artifacts.
For example:
jf rt build-promote my-build 1 target-repositoryPromotion can set status, comment, properties, source repository, and whether dependencies are included. By default, the operation moves artifacts. Set the copy option when the source artifacts must remain. Use the dry-run option to validate scope before a consequential promotion.
Apply Build Retention
Discard old build records by build name and retention parameters.
To apply build retention:
-
Run the following command.
jf rt build-discard <BUILD_NAME> --max-builds=<COUNT>Where:
<BUILD_NAME>: The name of the builds to discard.<COUNT>: The maximum number of build records to keep for that name.
For example:
jf rt build-discard my-build --max-builds=<COUNT>Retention can use maximum age, maximum count, and excluded build numbers. The artifact-deletion option also removes associated artifacts and increases the operation's impact. Review that option and permissions before running it.
Delete Build Information
Build deletion can target build records without deleting artifacts, while retention can optionally delete associated artifacts.
To delete build information:
- Treat these as different scopes and confirm the selected behavior before continuing.
- Don't infer artifact deletion from a control label alone. Review whether the selected operation removes only the build record or its associated artifacts.
Troubleshooting
The following table lists common symptoms and what to check.
| Symptom | Likely cause | What to check |
|---|---|---|
| Append cannot find the source build | It is unpublished or uses another project context | Source build name, number, publication status, and project |
| Promotion is denied | Source read or target deploy permission is missing | Account permissions and target repository |
| Promotion affects more files than expected | Source restriction or copy or move choice is wrong | Dry run, source repository, dependencies, and copy option |
| Retention removes unexpected content | Retention criteria or artifact deletion scope is too broad | Maximum age, maximum count, exclusions, and artifact-deletion option |
Related Topics
Updated 15 days ago
