Generic protocol commands

Use the Generic commands to work with Generic artifacts in Helix Artifacts.

Suggested repository structure

Helix Artifacts uses your repository structure to generate the repository name, group name, artifact id, and version for your repository. It is important that your depot path depth is a minimum of three folders deep so this process works and your repositories are displayed correctly in the web UI.

For example:

A repository structure of repo/sampleGeneric/com/perforce/test/sampleArtifact/1.1/sampleArtifact.bin corresponds to:

  • A repository name of sampleGeneric

  • A group name of com.perforce.test

  • An artifact id of sampleArtifact

  • A version of 1.1

  • An artifact file called sampleArtifact.bin

In this example, a repository with a depot path of sampleGeneric maps to //depot/sampleGeneric with a 1:1 mapping of //%%1/... as shown below:

sampleGeneric			//depot/sampleGeneric
  com				  com
    perforce			    perforce
      test			      test
        sampleArtifact		        sampleArtifact
          1.1			          1.1
            ...		            ...

Deploying an artifact

Tip

The artifact you are deploying must be available in your current directory.

To deploy an artifact, use the PUT command. For example, to deploy version 1.1 of the sampleArtifact.bin artifact to the sampleGeneric repository:

curl -X PUT -H "Content-Type: application/json" -d @sampleArtifact.bin http://localhost:1602/repo/sampleGeneric/com/perforce/test/sampleArtifact/1.1/sampleArtifact.bin

Helix Artifacts responds with:

{
  "status": {
    "code": 200,
    "message": "OK"
}    

Checking if an artifact exists in a repository

To check if an artifact exists in a repository, use the --head command. For example, to check if version 1.1 of the sampleArtifact.bin artifact exists in the sampleGeneric repository:

curl --head http://localhost:1602/repo/sampleGeneric/com/perforce/test/sampleArtifact/1.1/sampleArtifact.bin

Helix Artifacts responds with:

HTTP/1.1 200 OK

Fetching an artifact

To fetch version 1.1 of an artifact called sampleArtifact.bin from the sampleGeneric repository:

curl http://localhost:1602/repo/sampleGeneric/com/perforce/test/sampleArtifact/1.1/sampleArtifact.bin -o "sampleArtifact.bin"