简体   繁体   中英

Artifactory API to upload directory with contents

I was looking into the Artifactory REST API doc but I could not find any API that allows us to upload a directory with contents (can be files, subdirectory). There is only API to upload an individual file. I also found this where it stated that it can be done through GUI or the JFrog CLI. I wonder if I misread some documents and if there actually is a way to do that with the REST API.

In order to upload (aka "deploy") a directory with its contents via REST API you can use the Deploy Artifacts from Archive endpoint.

You'll need to create an archive file ( zip , tar , tar.gz ) with the directory and its contents, and call the upload API with the target folder, specifying the X-Explode-Archive: true request header.

Eg (simplified - omitted auth, etc.):

curl -X PUT https://jfrog.foo.bar/artifactory/my-repo-local/   \
     -H "X-Explode-Archive: true"                              \
     -T my-file.tar.gz

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM