1

I am currently trying to strategize the best way to store feature branches in Artifactory and use the feature branch SNAPSHOT builds in a dev environment. The feature branches are of the form: feature/X.X-Feature-DTBXXXXX-SNAPSHOT

So far I have created a separate repo in Artifactory and pointed the target release repo in Jenkins to deploy artifacts to that repo on building. This works fine except that because Maven looks for the qualifier SNAPSHOT in the branch name, it gets uploaded to the snapshot repo on Artifactory instead of the Feature repo.

The problem with this approach is that I am risking pollution of branches that are in the SNAPSHOT repo by uploading feature branches there.

I need to upload a feature branch to a Feature repo with names of the type feature/X-X-Feature-DTBXXXXX-SNAPSHOT and not to the SNAPSHOT repo.

Any help or pointers would be great.

k1992
  • 11
  • 3
  • I faced the same issue in Artifactory and the only workaround I found out was to remove snapshot from the artifact name. Otherwise Artifactory will pick the snapshot repos to deploy the artifacts. – Yug Singh Jan 27 '18 at 01:53
  • Another option will be to use the JFrog CLI as a rapper of your build and use its ability to upload artifacts based on regex or wildcards to different repositories. – Ariel Jan 27 '18 at 11:20
  • @Ariel I used the Jfrog CLI to upload to artifactory and it worked beautifully. So thanks for that. How would you go about wrapping something like a mvn clean deploy in a Jfrog CLI command? Do you have any resources I can refer to? – k1992 Feb 02 '18 at 22:46
  • Yes, you can read the wiki page of the JFrog CLI on Maven builds: https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-RunningMavenandGradleBuilds The command should look like: jfrog rt mvn "clean install -F /path/to/pom/" /path/to/jfrog/maven/configuration --build-name=build-name --build-number=1 – Ariel Feb 11 '18 at 14:07

1 Answers1

0

I saw this option from JFrog to automatically create and delete the JFrog repositories for feature branches.

https://jfrog.com/blog/automating-your-feature-branch-repository-management-with-jfrog-cli/