Download Artifacts from a Release Bundle in Jfrog - artifactory

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`

Related

Configuring Maven when using JFrog CLI

When trying to run a build of a maven application using jfrog CLI, one of the prerequisite steps is to run
jf mvn-config
When we run it manually on a server, it has an interactive step to configure the resolution for release dependencies (tab and select)
I am wondering is there a way to feed in the config parameters as CLI arguments to jf mvn-config so that we can set the properties programmatically for the repository?
I believe this comment from the JFrog CLI Github page and the --global attribute option described here would be an useful information. It is important to note that the configuration set up using jf mvn-config may override the global settings.

VSTS - Asp.Net Build with Project Dependencies and Git Repositories

Since VSTS has sought to bend to the popular Git source control, I have yet to see a good description of building .Net projects located in Git repositories, having project dependencies on one another.
For instance, in Visual Studio, I build a solution that includes projects with dependencies on each other. Then, in VSTS each of those .Net projects are versioned in separate Git repositories.
How, then, do you get a build on VSTS? How do you get the artifacts (read: DLLs) from one project into the project of the other?
UPDATE: 12/18/17
I took #VonC's suggestion and followed-through on a VSTS (Visual Studio Team Services) hosted Nuget package. I was able to make this work. This process makes .Net solution files and project dependencies OBSOLETE.
If you want to reuse a library, you can save the binaries as a NuGet package.
In the downstream project, you simply assign the VSTS url reference to the Nuget package to get the Nuget Restore to find/place the binaries in your build project.
You will have to download and install a Credentials tool that will allow you to push your binaries to VSTS's package location. Additionally, tell your admin to add the Packages functionality from the VSTS Marketplace.
Thanks, #VonC for the great suggestion!
Here are some helpful links:
Create and Publish the Private Nuget Package here
VSTS Marketplace Package Manager here
The idea is, for binary dependencies (DLLs) to not involve a source control tool (like Git) but a binary referential one (like Nuget)
See for instance:
"Package: NuGet"
"NuGet is now fully integrated into MSBuild"
With Visual Studio 2017 and .NET Core, we have improved the NuGet package management experience by introducing the PackageReference feature in MSBuild.
PackageReference brings new and improved capabilities such as deep MSBuild integration, improved performance for everyday tasks such as install and restore, multi-targeting and more.
First, it’s unnecessary to manage the build artifacts (such as dlls) in source control since they're the output files from the source code.
Then to add dependencies (dlls) from other repos to the parent (main) repo’s project, there usually has below options:
Option 1: manage the build artifacts as packages
As Vonc mentioned, you can manage the dlls as nuget packages, and then add nuget packages to your main repo’s project.
Option 2: git submodules
You can also treat other repos as the submodules for the main repo, and both build the projects from the submodules repos and the main repo in the build, then the main repo project can get the dependencies from the submodule repos’ build artifacts.
Commands to add a submodule for the main repo:
# In local main repo
git submodule add <URL for a submodule repo>
git commit -m 'add a submodule'
git push
Note: in VSTS build definition, you should select checkout submodules in Get Sources step.
Details about git submodules, you can refer Submodules.
Option 3: git subree (alternative way for git submodules)
Treat a branch from another repo as a subtree (a folder) in the main repo. Then build the projects both in the main repo and the subtrees, and get dependencies from subtrees for the main repo’s project.
Commands to add a subtree in the main repo:
git submodule add --prefix=submodule1 <URL for sub repo> master
git push
Then it will add a folder submodule1 with the files in the sub repo master branch, and commit the changes in the main repo.
Details about git subtree, you can refer
Git subtree: the alternative to Git submodule.
At any time, if your branch has working code with any version of dependent assemblies, I can't see any reason you need to do anything.
For example of dependencies here:
You can set dependencies in project like:
Also you can add dependencies in solution like :
You can set build order in solution too if your project has multiple project with dependencies.
As long as your current code in branch from which you are build is working (with any version of different assemblies, e.g. Classlibrary1 has version 1.0.0.0, Classlibrary2 has version 1.2.2.1 & so on but is working fine with each other after referencing) this approach will work.
Project dependencies exist for ages in Visual Studio & .Net. As long those project exist in same TFS branch You can add project dependency right in dependent project. Also you can manage Project build order in Solution.
For more complex scenarios like different repositories or branch dependencies you need to modify build workflow but it is also quite possible.
You can also refer
http://dailydotnettips.com/2015/11/25/how-to-identify-the-project-dependencies-in-visual-studio/
what I saw long time ago when I created same sample for test.

profile-refresh in Fuse 6.2 does not reload snapshot bundle

I am running JBoss Fuse 6.2.0.
I built a small camel application that just writes to the log every 5 seconds.
I built it and installed the SNAPSHOT bundle jar in my local Maven repository.
In the Karaf console I did the following:
fabric:profile-create --parent feature-camel logdemo
fabric:profile-edit --bundle mvn:com.company.project/logdemo logdemo
fabric:container-create-child --profile logdemo root child1
The camel application now worked as intended.
I then made a small change to the application, rebuilt it and installed the new SNAPSHOT bundle jar in my local Maven repo.
In the Karaf console I then did the following to get Karaf to load the new jar:
fabric:profile-refresh logdemo
But the loaded application is still the old version.
How do I get Karaf to look for the updated jar in my local maven repo? It seems like it has some internal cache it looks in instead.
Note: We're not using Maven to build the application, so all answers about using Maven plugins like the fabric8 plugin will be rejected.
You should use the fabric:watch * command for that. This will update all containers that run a snapshot version of an artifact that is updated in the local maven repo. If you want only a specific container to watch for updates use dev:watch * on the shell of that container.
See http://fabric8.io/gitbook/developer.html

Does berkshelf support multiple cookbooks? How?

I have two cooksbooks that I created in my Chef repo that I want to try to manage using Berkshelf.
One cookbook is dependent on the other. Both are not in Chef Supermarket. I don't want to add them there just for dependency resolving.
On on berks install this things complains about the other cookbook is missing.
This cookbook only exist as upload to my Chef server. It is not in Chef supermarket and also not in ~/.berkshelf/cookbooks/
Is this possible? Or does Berkshelf require all recipes in one cookbook? It is not possible to have dependencies between two cookbooks that are not in Chef supermarket?
The Berkshelf does not seem to deal with this use case of multiple interdependent cookbooks. There are also no commands to get cookbooks in ~/.berkshelf/cookbooks.
Berkshelf do support multiple cookbooks.
I've experience in managing more than 30 cookbooks in same berkshelf.
Berks can refer cookbooks from local path, git path, github sources and community cookbooks from Chef super market.
Update
Lets take the example of the scenario mentioned in the query. Please carry out the below steps,
You need to create a project repository with your cookbooks and other stuff.
Project repo is nothing but a directory containing other directories for Roles, Databags, Cookbooks and Environments.
Place your cookbooks inside cookbooks directory.
Create a Berksfile in the root of the repo.
Berksfile uses berkshelf. Install latest berkshelf version using gem install berkshelf (I would prefer using bundle install)
Example content of Berksfile
source "https://supermarket.chef.io"
# Mention community cookbooks used, if any
cookbook 'community_cookbook_name'
# Mention cookbook names from your repo
%w(my_cookbook_name_1 my_cookbook_name_2).each do | cookbook_name |
cookbook cookbook_name, path: 'cookbooks/' + cookbook_name
end
Community cookbook dependencies will get resolved using the source url in 1st line.
Now the basic project repo setup has been done. You're ready to run berks install
List items berks list
Please try the above steps and let me know if it's solved your purpose.
In case, if you want to upload the content, follow the steps below,
Create a directory ".chef" inside the project repository
Copy your Chef server knife/pem files into .chef
Run the command mentioned below from inside the project repo.
berks upload
Your cookbooks will be uploaded to Chef server using the command.
You can use knife upload data_bags and knife upload roles, to upload your databags and roles from the repo.

Deploying binaries from Bamboo to Nexus repository

Firstly I am new to Nexus. So please bear if it is too noob a question. Let me first explain how our current build/deployment process works.
HOW WE DO IT AT PRESENT:
We have a project that is Maven based. There is a parent POM.xml and two module pom.xmls Each child module POM.xmls create a JAR file each when built. Currently I am doing the build/ deployments manually. I checkout code from SVN to my local machine. I run mvn clean install. I have created a bash script to bundle the 2 Jar files + few other resources (Present just in SVN repo and gets downloaded to local) into a tar.gzip file. Now I SCP this to the app server. Run install scripts that deploys the tar.gzip file.
HOW WE WANT TO DO IT:
We plan to automate the build in Bamboo (Which I have already done). Then the built artifact needs to be uploaded to a Nexus repository (Due to security issues, the SCP task in Bamboo does not work because of establishing SSH connectivity from Bamboo Server to App Server).
MY FIRST HURDLE:
I have created a Bash Script task in Bamboo which does the bundling ( 2 Jars from each child Module POM + resources) to a tar.gzip. This tar.gzip is prersent in a path a/b/c/d on my bamboo machine.
How do I upload this tar.gzip to Nexus Repository?
MY CONFUSION:
I have read about uploading artifacts to Nexus. But I understand it if just 1 jar/ear/war file is created from the build. But we want the bundle. So if I make changes to settings.xml & POM.xml to configure the upload to NEXUS, each JAR file will be uploaded into separate paths in Nexus. And then I have to configure separately to upload the resource files (Not part of build). Is my understanding correct? Please let me know how to proceed with this?
Thanks in advance!!!
Use the Maven Assembly Plugin to create an assembly that contains your artifacts and resources, and then your regular maven deploy will deploy it into Nexus.

Resources