3
votes

I'm trying to upload an artifact from Bamboo CI using CLI for Jfrog Artifactory

I need to upload .p2 plugins and I have two options:

  • Upload the .zip and deploy it as Bundle Artifact
  • Upload the uncompressed folder with all subfolders and data.

I'm trying to upload the uncompressed folder with all the subfolders and data using this command:

jfrog rt upload --include-dirs=true ${bamboo.build.working.directory}/unzip/${bamboo.public.name-update-site}/* p2-release-local/${bamboo.public.name-update-site}/

But the problem is that the subfolders are empty.

Also I try to use this command:

jfrog rt upload --flat=false ${bamboo.build.working.directory}/unzip/${bamboo.public.name-update-site}/* p2-release-local/${bamboo.public.name-update-site}/

This command upload all the subfolders with all the data but the path isn't correct because is:

/name-update-site/datos/agents-home/xml-data/build-dir/PREDEL-RELPLU-JOB1/unzip/name-update-site

The content of the variable ${bamboo.build.working.directory} is

/datos/agents-home/xml-data/build-dir/PREDEL-RELPLU-JOB1/

EDITED: Log info:

INFO: Listing Bamboo directory
prueba-update-site.zip
unzip

INFO: Listing files from unzip folder
prueba-update-site

INFO: Listing files from custom folder 
artifacts.jar
content.jar
features  
plugins
site.xml
uninstall_fortify_plugins.cmd

Any help?

Thanks.

1
can you list your Bamboo work directory? It seems like the upload is taking the folders 'name-update-site' from there. If so just direct the 'jfrog cli' to the path you need to start from... for example: jfrog rt upload "./name-update-site/*" --flat=false ${bamboo.build.working.directory}/unzip/${bamboo.public.name-update-site}/* p2-release-local/${bamboo.public.name-update-site}/Ariel
INFO: Listing Bamboo directory name-update-site.zip unzip INFO: Listing files from unzip folder name-update-site INFO: Listing files from name-update-site folder artifacts.jar content.jar features plugins site.xml uninstall_name_plugins.cmdJavier C.
Could it be that your "target path" upload command argument does not end with a slash, and the CLI therefore renames your uploaded files to the same file name in Artifactory? It might be easier if you try to do this with no Bamboo variables first. It would be easier to see the actual command arguments values.Eyal Ben Moshe
Thanks for your help! This command is working for me: jfrog rt upload --flat=false "${bamboo.public.name-update-site}/*" p2-release-local/Javier C.

1 Answers

1
votes

Solved!

The solution is:

  1. Unzip the artifact .zip archive
  2. Upload with this command:

    jfrog rt upload --flat=false "${bamboo.public.name-update-site}/*" p2-release-local/
    

Thanks.