access Composer through api *or* Automate a package build

yarin
New Contributor II

Hi. We have a file that we want to generate and then to be built inside a packge
with a Post install script.
Is there a way to automate this process with composer ? maybe with an api?
Is someone familiar with a way to this with an npm module ?

2 REPLIES 2

mm2270
Legendary Contributor III

I'm not exactly sure what you need here. Are you saying you want to create a file on the fly, based on some conditions or variables that are captured at install time? If so, yes, this is possible to do. If the file is static and won't change, it can also be done, a few different ways.
Can you possibly clarify what you need here so an example of how to do it can be posted?

yarin
New Contributor II

We have an extension which we want to add to a pkg each new version by a script, so we could do this in automation via teamcity or something else. in each version we will change the extension file in the pkg but the rest stays the same.
we also need to have a post install script that should run after the installation of the pkg.
currently we are doing this manually , I create the pkg via composer.
So the question is how can we automate the procedure ? and does composer have an api we can use, so we could stay with it?