Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate option to create project #8

Closed
mbrodala opened this issue Dec 16, 2014 · 10 comments · Fixed by #9
Closed

Integrate option to create project #8

mbrodala opened this issue Dec 16, 2014 · 10 comments · Fixed by #9

Comments

@mbrodala
Copy link
Contributor

A new option, e.g. source => '<vendor>/<package>:<version>' could be integrated to allow executing composer create-project <vendor>/<package>:<version> <target>.

Example of the suggested configuration:

composer::project { $repository:
  ensure => present,
  source => 'typo3/cms-base-distribution:~6.2'
  target => $path,
  dev    => true,
}

This would execute composer create-project typo3/cms-base-distribution:~6.2 . in $path. Notice the trailing dot to ensure creation in the current execution path.

@igalic
Copy link
Contributor

igalic commented Dec 16, 2014

What's $repository in that case?

@mbrodala
Copy link
Contributor Author

Oh sorry, it's just a title like typo3.

@igalic
Copy link
Contributor

igalic commented Dec 22, 2014

reviewing this, it would appear that composer::project should actually be composer::install (or perhaps a type composer_install)

composer::create_project could be a separate defined type.

@mbrodala
Copy link
Contributor Author

The reason why I suggest this for composer::project is being able to define something like mentioned above. On the very first run, this would invoke composer create-project which in turn triggers composer install to initially resolve all dependencies. On continuous runs this only invokes composer install (unless an update should be enforced).

This is why I think having this in one place has its merits.

Otherwise I'd need a fact/inline template to determine whether to define composer::install or composer::project.

@igalic
Copy link
Contributor

igalic commented Dec 22, 2014

nod

@igalic
Copy link
Contributor

igalic commented Dec 22, 2014

igalic@levix % composer create-project --help
Usage:
 create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [package] [directory] [version]

Arguments:
 package                 Package name to be installed
 directory               Directory where the files should be created
 version                 Version, will default to latest

i'm thinking we should stick to package and add an optional version instead of source

even though our target diverts from composer's directory.

maybe we could add that option, and deprecate target…

@igalic
Copy link
Contributor

igalic commented Dec 22, 2014

@mbrodala with this now ^ it seems we have a fairly complete design.
would you like to attempt a patch?

@mbrodala
Copy link
Contributor Author

The reasons why I think source is better suited are these:

  1. In the puppet world basically everything that has a target option also offers a source option.
  2. With source we can promote the shorthand syntax <package>:<version> (source) while package would leave people requesting a version option.

@igalic
Copy link
Contributor

igalic commented Dec 22, 2014

+1

@mbrodala
Copy link
Contributor Author

Alright, I'll try to get this working and add a PR. Not sure if I can get around this year though.

mbrodala added a commit to mbrodala/puppet-composer that referenced this issue Dec 23, 2014
This internally invokes Composer's "create-project" command which allows for
creating projects based on other packages. To reduce the number of options the
shorthand syntax "<package>:<version>" supported by Composer is promoted.

Fixes Brainsware#8
mbrodala added a commit to mbrodala/puppet-composer that referenced this issue Dec 23, 2014
This internally invokes Composer's "create-project" command which allows for
creating projects based on other packages. To reduce the number of options the
shorthand syntax "<package>:<version>" supported by Composer is promoted.

Fixes Brainsware#8
mbrodala added a commit to mbrodala/puppet-composer that referenced this issue Dec 29, 2014
This internally invokes Composer's "create-project" command which allows for
creating projects based on other packages. To reduce the number of options the
shorthand syntax "<package>:<version>" supported by Composer is promoted.

Fixes Brainsware#8
mbrodala added a commit to mbrodala/puppet-composer that referenced this issue Dec 29, 2014
This internally invokes Composer's "create-project" command which allows for
creating projects based on other packages. To reduce the number of options the
shorthand syntax "<package>:<version>" supported by Composer is promoted.

Fixes Brainsware#8
mbrodala added a commit to mbrodala/puppet-composer that referenced this issue Jan 27, 2015
This internally invokes Composer's "create-project" command which allows for
creating projects based on other packages. To reduce the number of options the
shorthand syntax "<package>:<version>" supported by Composer is promoted.

Fixes Brainsware#8
mbrodala added a commit to mbrodala/puppet-composer that referenced this issue Jan 27, 2015
This internally invokes Composer's "create-project" command which allows for
creating projects based on other packages. To reduce the number of options the
shorthand syntax "<package>:<version>" supported by Composer is promoted.

Fixes Brainsware#8
@igalic igalic closed this as completed in #9 Jan 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants