我的目标是将一个composer.json
文件提交到我们的项目存储库,该文件指定应该为该项目使用哪些主题或插件,并且当开发人员拉下存储库时,他们需要做的就是运行 composer install。我们希望将插件排除在项目 repo 之外,以阻止项目 repo 的膨胀以及拉取和推送变得缓慢。
对于标准的 wordpress 插件,例如“WordPress.com 的 Jetpack”,这很好,因为我们将使用https://wpackagist.org/。但是,对于无法开源的插件和内部定制插件的高级付费,我们希望将它们托管在 Private Composer 存储库中。
因为我们将有这些插件的多个版本,所以我希望所有版本都显示,例如 1.1、1.2、1.3,以便开发人员可以在 composer.json 中指定需要哪个版本,例如,如果将来的版本出现问题并且我们需要回滚到以前的版本。
我已经阅读了设置 Satis 私有存储库的基础知识,但我无法让它遍历版本的 git 标签,也无法指定它是一个 Wordpress 插件并将其安装在正确的位置。
这是我第一次尝试获取所有带有 git 标记的版本:
{
"name": "Private Repository",
"homepage": "http://packages.privaterepo.com",
"repositories": [
{
"type": "vcs",
"url": "git@bitbucket.org:companyname/project.git"
}
],
"require-all": true
}
这是我必须指定版本但将其安装在正确的 Wordpress 插件位置的地方:
{
"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": "git@bitbucket.org: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"]
}
}
}
谁能建议我如何让这两种情况一起工作?