/puppet-composer

Puppet module for PHP composer

Primary LanguageRubyApache License 2.0Apache-2.0

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