My objective is to have a composer.json
file committed to our project repository that specifies what theme(s) or plugin(s) should be used for that project and when a developer pulls down the repo all they need to do is run composer install. We want to keep the plugins out of the project repo to stop the bloating of the project repo and it becoming slow to pull and push.
For standard wordpress plugins such as "Jetpack by WordPress.com" this is fine as we will use https://wpackagist.org/. However for Premium paid for plugins and custom made ones in house that cannot be open sourced we want to host them in a Private Composer Repository.
Because we will have multiple versions of these plugins I would like all versions to show such as 1.1, 1.2, 1.3 so the developer can specify in the composer.json which version is required, e.g. if a future version breaks something and we need to rollback to previous version.
I have read through the basics of setting up a Satis private repository which I have done so but I cannot get it to loop through the git tags of the versions and also specify that its a Wordpress plugin and install it in the correct location.
This was my first attempt in which it gets all git tagged versions:
{
"name": "Private Repository",
"homepage": "http://packages.privaterepo.com",
"repositories": [
{
"type": "vcs",
"url": "[email protected]:companyname/project.git"
}
],
"require-all": true
}
And this is one where I have to specify the version but get it to install in the correct Wordpress plugin location:
{
"name": "Private Repository",
"homepage": "http://packages.privaterepo.com",
"repositories": [
{
"type": "package",
"package": {
"name": "company/project",
"description": "WordPress Plugin",
"version": "1.0",
"source": {
"type": "git",
"url": "[email protected]:company/project.git",
"reference": "origin/master"
},
"type": "wordpress-plugin",
"require": {
"php": ">=5.3.2",
"composer/installers": "*"
}
}
}
],
"require-all": true,
"require-dependencies": true,
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
}
}
}
Can anyone advise how I get both of these scenarios to work together?