drupol/composer-package-artifacts

Composer plugin that allows to download a specified artifact instead of the default package.

dev-master 2019-06-21 15:21 UTC

This package is auto-updated.

Last update: 2020-10-21 18:37:23 UTC


README

Latest Stable Version GitHub stars Total Downloads Build Status Scrutinizer code quality License

Composer Package Artifacts

Composer plugin that allows to download a specified artifact instead of the default dist URL, this allows to download all artifact dependencies too.

Table of contents:

Installation

The recommended way of installing the plugin is via [Composer][2].

composer require drupol/composer-package-artifacts

Usage

Edit the composer.json file and add the following in your extra section:

{
    "extra": {
        "artifacts": {
            "foo/bar": {
              "provider": "github",
              "dist": {
                "url": "https://github.com/{name}/releases/download/{version}/{project-name}-{version}.tar.gz",
                "type": "tar"
              }
            },
            "abc/def": {
              "provider": "local",
              "dist": {
                "url": "file://somewhere/local/{version}/{project-name}-{version}.tar.gz",
                "type": "tar"
              }
            }
        }
    }
}

This will fetch dist content from:

https://github.com/foo/bar/releases/download/0.1.0/bar-0.1.0.tar.gz"

Valid type values are tar and zip while available URL replacement tokens are:

  • {name}: the full package's name without version info, e.g. foo/bar
  • {vendor-name}: just the vendor name, e.g. foo
  • {project-name}: just the project name, e.g. bar
  • {pretty-version}: the pretty (i.e. non-normalized) version string of this package, e.g. 0.1.0
  • {version}: the full version of this package, e.g. 0.1.0.0
  • {stability}: the stability of this package, e.g. dev, alpha, beta, RC or stable
  • {type}: the package type, e.g. library
  • {checksum}: the SHA1 checksum for the distribution archive of this version