Deploy Composer Packages

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

Once you connect Composer to Artifactory, you can deploy packages to the specified repositories. Since there is no direct deploy command in the Composer CLI, you can use the REST API to deploy packages to Artifactory.

To deploy Composer packages:

  1. From the root directory of the package, run this command to deploy the package to an existing archive:

    curl -L -u<USERNAME>:<AUTH> "https://[JFrogPlatformURL]/artifactory/<REPO_NAME>/<DESTINATION_PATH>" -T <PATH_TO_FILE>

    Where:

    • <USERNAME>: Your Artifactory username

    • <AUTH>: Your Artifactory identity token

    • [JFrogPlatformURL]: Your organization's Artifactory URL

    • <REPO_NAME>: The name of the target repository

    • <DESTINATION_PATH>: The destination path of the package within the target repository

    • <PATH_TO_FILE>: The path to the package on your local machine

    For example:

    curl -L -ujeffry:51HnvD0A1g2q3n4b5F6g7H8j9K0l1m2N3o4P5q6R7s8T9u0V1w2X3y4 "https://company.jfrog.io/artifactory/composer-local/psr/log/3.0.0.0.zip" -T ~/Downloads/3.0.0.0.zip
  2. If the composer.json file does not include a version attribute for the package, specify the version as a matrix parameter:

    curl -L -u<USERNAME>:<AUTH> "https://[JFrogPlatformURL]/artifactory/<REPO_NAME>/<DESTINATION_PATH>;composer.version=<VERSION>" -T <PATH_TO_FILE>

    Where:

    • <USERNAME>: Your Artifactory username

    • <AUTH>: Your Artifactory identity token

    • [JFrogPlatformURL]: Your organization's Artifactory URL

    • <REPO_NAME>: The name of the target repository

    • <DESTINATION_PATH>: The destination path of the package within the target repository

    • <VERSION>: The Composer version number

    • <PATH_TO_FILE>: The path to the package on your local machine

    For example:

    curl -L -ujeffry:51HnvD0A1g2q3n4b5F6g7H8j9K0l1m2N3o4P5q6R7s8T9u0V1w2X3y4 "https://company.jfrog.io/artifactory/composer-local/psr/log/3.0.0.0.zip;composer.version=3.0.0" -T ~/Downloads/3.0.0.0.zip

Note

You can also use JFrog Set me up to copy the snippet populated with your token and environment. For more information, see Use Artifactory Set Me Up for Configuring Package Manager Clients.