marvincaspar/composer-azure-plugin

Azure Composer plugin

Installs: 9 777

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 8

Open Issues: 0

Type:composer-plugin

2.0.2 2023-04-05 07:21 UTC

This package is auto-updated.

Last update: 2024-04-05 09:24:57 UTC


README

Build status codecov

Composer Azure Plugin

Composer Azure plugin is an attempt to use Composer with Azure DevOps artifacts, via universal packages.

Install

Composer Azure Plugin requires Composer 2 and PHP8.1 or newer. It should be installed globally.

$ composer global require marvincaspar/composer-azure-plugin

You have to be logged in via the Azure command line interface .

Usage

This plugin has two components. Publishing a composer package to azure and pulling the dependency.

Publishing a package

In the package you want to publish you have to add an azure-publish-registry config to the extra block.

{
    ...
    "extra": {
        "azure-publish-registry": {
            "organization": "dev.azure.com/<my-organization>",
            "project": "<my-project-name>",
            "feed": "<my-feed-name>"
        }
    }
}

This plugin adds a new composer command to easily publish the package. Just run composer azure:publish and it will remove all ignore files (e.g. the vendor folder) and publish the code to azure artifacts.

Use package as dependency

To use a published package add an azure-repositories config to the extra block. There you define which packages are required for the current project. In the required block you then define the requirements as usual. The only downsite is, that you can't use constraints and set a specific version.

{
    "require": {
        "vendor-name/my-package": "1.0.0"
    },
    "extra": {
        "azure-repositories": [
            {
                "organization": "dev.azure.com/<my-organization>",
                "project": "<my-project-name>",
                "feed": "<my-feed-name>",
                "symlink": false,
                "packages": [
                    "vendor-name/my-package"
                ]
            }
        ]
    }
}