I have a remote Maven-repository where I would like to copy a subset of the artifacts to a local repository on the same Artifactory server.
But the GUI does not display the copy-option when I right-click on the artifact and the copy-method in the REST API is only supported for local repository.
https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-CopyItem
What is the best thing to do ? Do I need to download the artifacts and "republish" them to the local repository ? Is there not smarter way to copy the artifacts from a remote to a local repository ?
You can use this method as a workaround:
Retrieve artifact from remote repository: GET {remoteRepoKey}/{filePath}. You don't have to save the file in your local machine. As by-product, the download process will copy the item from remoteRepoKey to remoteRepoKey-cache.
Move item from remoteRepoKey-cache to your local repository: POST /api/move/{remoteRepoKey-cache}/{filePath}?to=/{localRepoKey}/{filePath}
It is not perfect, but it'll spare an upload to Artifactory and also the issues of storing a file in filesystem.
Further reading:
What is a Remote repository and how does it work?
Remote Repositories
My blog: Artifactory as a Caching Mechanism for Package Managers
Related
How can I create a remote repo to a Git server, which is not GitHub, and is hosted on prem (along with Artifactory)?
We currently use Go mod or Glide with "regular" git clone and no Artifactory. In order to make the transition from "regular" to Artifactory smooth, I have to create a remote registry to point to my Git server and setup GOPROXY. Since part of the artifacts will be in Artifactory Go-local and part of them will be in the Git server I might be facing a problem. I think that even JFrog-cli tool will have to make 2 step to pull the data (first with --no-registry and the second "with-registry").
Since the docs explains only how to setup Github and GoCenter remote registries, and I would like to be able to pull code from any other type of git servers as well.
Is there a script or any other automated process for migration of artifacts into JFrog? We are currently working on this and need more information to carry out this process. Please help us in achieving this. Thanks in advance.
If you have an existing artifact repository, JFrog Artifactory supports acting as an artifact proxy while you are in the process of migrating to Artifactory.
I would recommend the following:
Create a local repository in artifactory
Create a remote repository in artifactory which points to your current artifact repository.
Create a virtual repository in artifactory which contains both the local and remote repositories.
Iterate on all your projects to have them publish to the local artifactory repository and pull from the virtual repository.
The advantage to this workflow is that you can port things over piece by piece, rather than trying to do it all at once. If you point a dependency at artifactory that hasn't been ported there yet, artifactory will proxy it for you. When the dependency is ported over, it will be transparent to its users.
When you have moved everything to your local Artifactory repository, then you can remove the remote repository from your virtual repository.
The relevant documentation is available here: https://www.jfrog.com/confluence/display/RTF/Configuring+Repositories
For an Enterprise account, I'd suppose S3 storage and a significant number of artifacts, so there will be no easy and automated way to do it. It also highly dependent on the storage implementation of choice in the on-prem solution. If you plan to use S3 storage, JFrog can help to perform S3 replication. In other scenarios, the solution will be different. I suggest contacting the support.
Our setup includes a company wide Artifactory that holds in-house-built artifacts as well as goes out and fetches publicly available artifacts. I’m trying to setup a local Artifactory at our location that would fetch publicly available artifacts through the regular internet, but would connect to the company wide Artifactory for our in-house-built artifacts. Is this possible?
In my local Artifactory setup, I put the company wide Artifactory URL as a Remote Repository. I can hit the Test button and it tells me that it successfully connected. However, when I go to download an artifact it does not work. I would like to say that publicly available artifacts can be fetched through my local Artifactory, so at least I can get to jcenter.bintray.
Can one Artifactory be connected to another Artifactory? If yes, is there a way to test if this connection works
I don’t think we would be using all the contents of the company wide Artifactory, so I don’t want to do an export and import to the local or do replication. I would prefer if we could fetch on demand. Is this possible?
Edit: Thanks to #DarthFennec pointing me to Smart Remote Repositories I have solved my problem. To others who have the same problem
Please follow the steps mentioned on the previously mentioned page to set up the Smart Remote Repository. In my case Artifactory did not detect that the remote was another instance of Artifactory and did not give me any options to set, but I was not interested in these anyway.
Note You can always click the Test button to make sure that your connection to the Remote Repository works.
Next, go to the Admin -> Virtual Repositories select your Repository Key and select your Smart Repository from the Available Repositories so that it moves into the Selected Repositories. Click Save & Finish at the bottom and you should be good to go.
I'm not sure exactly what your problem ended up being, but if you want to remote one Artifactory repository from another, it should be a smart remote repository. This is when Artifactory detects that a remote is pointing at another Artifactory, and it enables a number of extra features, like download statistics, property replication, and remote browsing.
An important thing to keep in mind when configuring a smart remote repository is that depending on the package type, you might need to point the remote at <artifactory>/api/<type>/<repo>, rather than just <artifactory>/<repo>. This is the case for Bower, Chef, CocoaPods, Docker, Go, NuGet, Npm, Php Composer, Puppet, Pypi, RubyGems, and Vagrant repositories. Other repository types should use the standard <artifactory>/<repo> URL.
Is there some way to link Conan packages over local repositories like Bintray (conan-center) ?
I read Manipulating Artifacts but I just found Copy and Move features.
Regards.
Artifactory does not support linking artifacts between repositories.
As you mentioned, you can copy artifacts between repositories. Keep in mind that this is a "cheap copy" - since Artifactory is using a checksum based storage, the bytes are not duplicated and instead Artifactory just creates another pointer in the database.
Another option for having the same artifact in multiple repositories is using virtual repositories (will be supported in the future for Conan). You can keep the artifact in a local repository and include this local repository in multiple virtual repositories. This will result with being able to access the same artifact from multiple virtual repositories.
I m writing a web application where it accepts the git URL and file to read and then displays the file on the webpage. I m using JGit for this. I see that JGit needs a local repository to clone before viewing the file. Since this is server, I do not have access to local files. So, is there anyway I can access the git remotely and view the file from there?
Thanks
It's not just JGit that needs a local repository, Git itself requires a local repository. Centralized version control systems like CVS and SVN had remote server viewing built-in, but decentralized systems (such as Git and Mercurial) typically do not.
If you want to browse a Git server, you have to make a local clone, but you could do this in the background for the user.
You might also be interested in the GitHub API, which lets you do what you want, but only for repositories hosted by GitHub.