0
votes

I've been researching this for a while but can't find an answer. I use Bamboo 5.3 with Artifactory plugin 1.6.2. I have a build project that generates a .war and two .zips. I also have a Bamboo Deployment project that creates releases with these three files and deploys to DEV, QA and so on.

For a build project I am able to use the artifactory plugin, that's fine. The problem is that I end up with a lot of artifacts if I publish all the builds. I would like to publish to Artifactory only the files from the releases, so that is happens less often, and that the people would see only the 3-4 releases tries, not the 150 builds.

My issue is that when creating my Deployment tasks (like download, copy, call ssh script...) there is no 'Artifactory Generic Deploy', like in the build project tasks.

I see there is a new Bamboo 5.4 with some improvement around the deployment process, maybe this could help?

3
I really urge you to keep all the builds. If you are looking to save space, just enable snapshot cleanup. - JBaruch
The builds are still there in Bamboo. I just want to send to Artifactory the ones that made it to be a Release. That way the people who need to implement them in PROD can grab only those. It would be nice to be able to promote a Release to Artifactory. - Icegras
But why you keep them in Bamboo instead of in Artifactory? Bamboo is not intended to keep binaries, Artifactory is. If you don't want people to see your snapshots, configure the snapshot repository permissions. - JBaruch

3 Answers

7
votes

Support for deployment task from Bamboo to Artifactory will be available starting with version 1.8.0 of the Artifactory plugin.

Here is the Jira issue.

1
votes

I faced a similar issue. Hopefully the next release of the artifactory plugin will integrate with deployment projects.

If you are willing to use Maven to broker the deployment, deploy-file can get the job done.

In the deployment project, after your artifact download task add a Maven 3.x task for each artifact you want to send.

You'll need to specify a build JDK and for environment variables I'm using MAVEN_OPTS="-DskipTests=true -XX:MaxPermSize=4096m"

For the actual maven command:

deploy:deploy-file 
-Durl=http://${bamboo.artifactory_username}:${bamboo.artifactory_password}@${bamboo.artifactory_url}/artifactory/${bamboo.destinationRepo}
-DrepositoryId=localhost
-Dfile=${bamboo.pathToArtifact}/${bamboo.arftifactName}-${bamboo.majorVersion}.${bamboo.minorVersion}.${bamboo.arftifactExtension}
-DgroupId=${bamboo.arftifactGroup}
-DartifactId=${bamboo.arftifactName}
-Dversion=${bamboo.majorVersion}.${bamboo.minorVersion}
-Dpackaging=${bamboo.arftifactExtension}
-DgeneratePom=true

Hope this helps!

0
votes

The artifactory API is pretty usable for this purpose. You can deploy directly using curl in a shell script.

See https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API for the details.