Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deploy a file to Artifactory using the command line?

I've spent far more time on this than I care to admit. I am trying to just deploy one file into my Artifactory server from the command line. I'm doing this using gradle because that is how we manage our java builds. However, this artifact is an NDK/JNI build artifact, and does not use gradle.

So I just need the simplest gradle script to do the deploy. Something equivalent to:

scp <file> <remote> 

I am currently trying to use the artifactory plugin, and am having little luck in locating a reference for the plugin.

like image 237
Andrew Prock Avatar asked Nov 19 '13 00:11

Andrew Prock


People also ask

How do you manually upload to Artifactory?

Upload to the Artifactory repository manually The easiest way, and the least DevOps-friendly way, to upload a JAR to an Artifactory repository is to simply log in to the administrative console, select a target folder and drag and drop the JAR onto the deployment screen.

What is the command to run Artifactory?

Manage Artifactory using the following commands. Access Artifactory from your browser at: http://SERVER_ HOSTNAME:8082/ui/ . For example, on your local machine: http://localhost:8082/ui/ . Check Artifactory Log.


2 Answers

curl POST did not work for me . PUT worked correctly . The usage is

curl -X PUT $SERVER/$PATH/$FILE --data-binary @localfile 

example :

$ curl -v --user username:password --data-binary @local-file -X PUT "http://<artifactory server >/artifactory/abc-snapshot-local/remotepath/remotefile" 
like image 94
diptia Avatar answered Sep 19 '22 12:09

diptia


Instead of using the curl command, I recommend using the jrog CLI.

Download from here - https://www.jfrog.com/getcli/ and use the following command (make sure the file is executable) -

./jfrog rt u <file-name> <upload-path> 

Here is a simple example:

./jfrog rt u sample-service-1.0.0.jar libs-release-local/com/sample-service/1.0.0/ 

You will be prompted for credentials and the repo URL the first time.

You can do lots of other stuff with this CLI tool. Check out the detailed instructions here - https://www.jfrog.com/confluence/display/RTF/JFrog+CLI.

like image 39
Gilad Sharaby Avatar answered Sep 19 '22 12:09

Gilad Sharaby