This document describes how to store Composer artifacts in CODING-AR for centralized artifact management and version control. The following sections introduce how to create an artifact, configure authentication, and pull and push artifacts.
Note:Before you begin:
- Install Composer.
- Create an artifact repository (see Basic Operations).
- Select Composer as the repository type.
Run the following command to install Composer.
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Create a demo directory.
mkdir composer-demo && cd composer-demo
composer inits
Go to the directory where the Composer package is located and create an auth.json
file. You can select manual or automatic configuration.
Click Generate configuration from access token and then copy the content to the auth.json
file.
Copy the commands on the webpage and replace [PASSWORD]
with your service password.
Run the commands on the CODING-AR page to compress Composer package files into a zip
package and then push it to the repository using tools such as cURL
.
Enter the password configured in auth.json
and replace <version>
with the specific version number.
After the push is successful, you can view the package in CODING-AR.
Go to the Composer package directory and set the repository URL. You can use the commands in CODING.
Replace the Composer source with the CODING repository (optional).
composer config repo.packagist false
composer require < PACKAGE >:< VERSION >
If you try to pull an artifact that does not exist in the CODING private repository, the system will try to pull from the configured proxy. You can add a third-party artifact source to obtain artifacts from the specific repository. Without the need for configuration, CODING will retrieve artifacts in sequence from top to bottom.
Was this page helpful?