JFrog cli deploy a single file to artifactory target directory - artifactory

I need to delete old snapshots from the Artifactory. For cleanup we recently configured Max Unique Snapshots to 5, but the garbage collector only deletes the old snapshots when a new snapshot is deployed.
How do I deploy a single file to the Artifactory using the JFrog-cli? I am unsure of which command to use from their documentation. https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory

You can deploy a single file to Artifactory using the CLI with the upload command, for example:
jfrog rt u froggy.tgz my-local-repo
For additional documentation about the upload command take a look at the JFrog CLI documentation

Related

Download Artifacts from a Release Bundle in Jfrog

When I create release bundles in Jfrog and then move them to a satellite, all artifacts on the satellite are placed in repositories from where I can download them. But they are stored there without reference to a specific release bundle. I can download any combination of artifacts. I am asking me if there is a possibility to download artifacts not from the repository but from the release bundle.
For that i would suggest to use the Jfrog CLI:
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Thats a tool developed in Jfrog itself for ease of use.
After you configure it (`jfrog config add`) you can use the following command to download all the files of a release bundle:
`jfrog rt dl --bundle bundle_name/bundle_version`

How do I delete a specific Jfrog build with the cli (and its corresponding artifact)

I'm confused about how to perform this operation, it almost seems like it's not supported. Looking at the docs I see no examples for deleting a specific build version: https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-DiscardingOldBuildsfromArtifactory
I use build discarding now, but that's not what this is. I want to remove a specific build version and its corresponding artifact, not use --max-days or --max-builds. How is this possible? I want to delete the build AND the artifact.
I use Jfrog to host an internal helm repo, helm has no built-in command to delete a chart from a remote repo.
For deleting a specific artifact of a build using jfrog cli run
jfrog rt delete --build build-name/build-number
Parse --dry-run to know which artifacts would have been deleted.
More info on CLIforJFrogArtifactory-DeletingFile.

Incorrect directory structure created using jfrog CLI

I am trying to download the entire folder (as it is with all files and subfolders) from an Artifactory repo to my local folder.
Note - I am using Artifactory Pro cloud version
This how my Artifactory local repo (generic) looks like -
I run the following command in jfrog CLI (used this article as refrence) -
jfrog rt download --include-dirs=true --flat=true --user=XXX --password=XXX --url=https://XXXX.jfrog.io/XXXX --recursive '/support-pack/aem-dispatcher/files/(*)' '{1}'
The files get downloaded however it results in a weird folder structure -
Below is a screenshot of the logs
Notice the additional resume folder under the resume folder. Why is this happening?
I want the exact structure under files folder in Artifactory to be replicated in my local folder.
Please help!
The answer turned out to be much simpler than expected. All I had to do was get rid of --include-dirs=true in my command.
Read this article for more info.

could not download symlink from artifactory using jfrog cli

jfrog rt dl --symlinks=true generic-local/latest.tgz
Getting "Incorrect Usage".
jfrog cli version 1.18.0.
Is it possible to download a symlink data from jfrog CLI?
In jfrog cli, --symlink is a parameter used for preserving the soft links structure in Artifactory during the upload.
So for downloading you can use the following command
jfrog rt dl generic-local/latest.tgz
In addition, when downloading symlinks stored in Artifactory, the CLI can verify that the file to which the symlink points actually exists and that it has the correct SHA1 checksum. To add this validation, you should use the --validate-symlinks option with the download command.

Artifactory: Converting remote repo to local repo

My employer has been misusing Bintray as our binary repository for some time. We are finally moving to Artifactory instead and closing down Bintray. But this seems to be an almost impossible task. There is no way of exporting Bintray repos to a zip. Downloading the repos means manually downloading each file from the UI or through their API. I have tried two approaches for automation:
1) wget for crawling our bintray like this:
wget -e robots=off -o ~/wget.log -w 1 -m -np --user --password "https://.bintray.com"
which yielded all of the files in the repos. But this only solves half the problem. I couldn't find out how to import the files to a repository in artifactory (all the repos are over 100mbs each and therefore can't be uploaded, for some reason).
2) I set the Bintray repos up as remote repositories and enabled Active Replication. That seems to have worked for now. But I don't know if they will be removed when the Bintray account is moved or even if they are stored in Artifactory. Therefore I would like to convert the remote repo to a local repo, to make sure that it is permanently stored in artifactory is there a way of doing this? If so, how?
I'll try to address both of your questions below.
What do you mean you can't upload more than 100mb? Which version of Artifactory are you using? On-prem or SaaS-based installation? How are you trying to upload your files to Artifactory? Have you tried to import the content by using the import feature of Artifactory? (Admin --> Import&Export --> repository Import)
It sounds like you are using the UI for the upload, and if so you can configure the max upload size in Admin --> General Configuration page.
If you mean that you have all of the content from Bintray cached in your remote repository cache in Artifactory just use the "Copy" or "Move" option and move the content to a local repository. This will ensure that all of the content is stored locally.

Resources