Forge Home

composer

manage PHP composer installation as well as installation and update of projects using composer

25,192 downloads

9,872 latest version

3.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.3.5 (latest)
  • 0.3.0
  • 0.2.6
  • 0.2.5
  • 0.2.4
  • 0.2.3
  • 0.2.2
  • 0.2.1
released Mar 3rd 2017
This version is compatible with:
  • Puppet Enterprise 3.3.x
  • Puppet >=2.7.20 <4.0.0
  • , , , , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'brainsware-composer', '0.3.5'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add brainsware-composer
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install brainsware-composer --version 0.3.5

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: php, composer

Documentation

brainsware/composer — version 0.3.5 Mar 3rd 2017

Puppet Module for PHP composer

Build Status

manage installation of composer as well as the installation and update of projects with composer.

This project was initially forked from willdurand-composer, adding basic functionality already provided from tPl0ch-composer. Because everyone is a unique snowflake and we needed one true (i.e.: our) way of handling composer.

Documentation

Installing composer

     include composer

Installing composer from a package:

     class { 'composer':
       provider => 'package',
     }

Installing composer from a that installs it in a weird directory:

     class { 'composer':
       provider   => 'package',
       target_dir => '/opt/es/bin',
     }

Installing composer from a third-party module's class:

     class { 'composer':
       provider   => 'php::composer',
     }

Installing a project's dependencies with composer. n.b.: This directory must already exist. We recommend tracking it with puppetlabs-vcsrepo

     # track yolo-site's stable branch:
     vcsrepo { '/srv/web/yolo':
       ensure   => 'latest'
       provider => 'git',
       source   => 'git://example.com/yolo-site.git',
       revision => 'stable',
     }

     # install yolo project without dev packages:
     composer::project { 'yolo':
       ensure  => 'installed',
       target  => '/srv/web/yolo',
       dev     => false,
       require => Vcsrepo['/srv/web/yolo'],
     }

To keep a project up-to-date we can use the ensure => latest

     # Keep yolo project up-to-date, with dev packages, ignore the lock file:
     composer::project { 'yolo':
       ensure  => 'latest',
       target  => '/srv/web/yolo',
       dev     => true,
       lock    => true,
       require => Vcsrepo['/srv/web/yolo'],
     }

To create a project based on another package we can use the $source

    composer::project { 'typo3-cms':
      ensure => 'present',
      source => 'typo3/cms-base-distribution:~6.2',
      target => '/srv/web/typo3',
    }

Ensuring a composer repository is added:

composer::repository { 'repository'
  ensure => present,
  type   => 'vcs',
  url    => 'git@github.com:user/repository.git',
  target => '/path/to/project,
}

This modifies the composer.json of the project. Composer repositories may also be added globally:

composer::repository { 'global'
  ensure => present,
  type   => 'vcs',
  url    => 'git@github.com:user/repository.git',
  global => true,
}

Patches and Testing

Contributions are highly welcomed, more so are those which contribute patches with tests. Or just more tests! We have rspec-puppet and beaker tests. When [contributing patches](Github WorkFlow), please make sure that your patches pass tests. For more info, please check our CONTRIBUTING

Release process

The module is versioned according to semver. It uses blacksmith for cutting releases.

License

Apache Software License 2.0. See the LICENSE for the full text, or checkout the FAQ for what that actually means.

Contact

You can send us questions via mail puppet@brainsware.org, or reach us IRC: igalic hangs out in #puppet

Support

Please log tickets and issues at our Project's issue tracker