netpromotion/deployer

从仓库中取数据并将非忽略的文件上传到远程服务器

v1.0.6 2018-01-09 21:55 UTC

This package is not auto-updated.

Last update: 2024-09-26 06:44:47 UTC


README

它从仓库中获取数据并将非忽略的文件上传到远程服务器

如何使用它

  1. 转到您的项目目录
  2. 运行 composer require --dev netpromotion/deployer
  3. 创建 deploy.json 文件
  4. 配置方式类似于 dg/ftp-deployment,差异
    • log 是一个对象,包含两个可选键:config 是最终配置的备份路径,output 是输出日志的路径
    • ignore 是一个数组,包含额外的忽略文件(覆盖 .gitignore
  5. 私有属性(例如 remote)提取到 deploy.local.json 文件
  6. 运行 ./vendor/bin/deploy

示例

deploy.json

{
  "test": true,
  "log": {
    "config": "/deploy.config.log"
  },
  "ignore": [
    "/tests/",
    "!/vendor/"
  ],
  "before": [
    "local: git tag -f deployed",
    "local: git push -f origin deployed",
    "local: composer install"
  ],
  "after": [
    "http://server.tld/deployed.php"
  ]
}

deploy.local.json

{
  "test": false,
  "remote": "ftp://user:password@server.tld/directory"
}