1 Star 0 Fork 0

geeknonerd/deploy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

deploy

简化版Shell部署脚本,可直接在服务器上执行.

Englist Document

该项目Fork自 deploy, 原项目将Shell脚本放置的本地电脑, 通过SSH远程执行命令; 本脚本是放置在远程服务器上直接执行

安装

$ make install

访问原始 wiki 以获取更多使用信息。

使用

  Usage: deploy [options] <env> [command]

  Options:

    -C, --chdir <path>   change the working directory to <path>
    -c, --config <path>  set config path. defaults to ./deploy.conf
    -T, --no-tests       ignore test hook
    -V, --version        output program version
    -h, --help           output help information

  Commands:

    setup                run remote setup commands
    revert [n]           revert to [n]th last deployment or 1
    config [key]         output config file or [key]
    curr[ent]            output current release commit
    prev[ious]           output previous release commit
    exec|run <cmd>       execute the given <cmd>
    list                 list previous deploy commits
    [ref]                deploy to [ref], the 'ref' setting, or latest tag

配置

默认情况下,deploy(1) 将查找 ./deploy.conf,由一个或多个环境、[stage][production] 等组成,然后是指令。

[stage]
repo git@github.com:visionmedia/express.git
path /var/www/myapp.com
ref origin/master
post-deploy /var/www/myapp.com/update.sh

指令

ref (可选的)

被指定时,HEAD 重置为 ref。在部署生产环境时,通常不会使用它,因为 deploy(1) 默认使用最新的标签,但是这对于暂存环境很有用,如下所示,其中 HEAD 已更新并设置为开发分支。

    ref origin/develop

repo

要克隆的 GIT 存储库。

   repo git@github.com:visionmedia/express.git

path

部署路径。

    path /var/www/myapp.com

Hooks

所有 hooks 都是任意命令,相对于path/current执行,pre-deploy 用于先前部署和 post-deploy用于新部署后。当然你也可以指定绝对路径。

pre-deploy

  pre-deploy ./bin/something

post-deploy

  post-deploy ./bin/restart

test

测试命令用于 post-deploy 执行后。如果这命令失败,deploy(1) 将尝试恢复到上一个部署,并忽略当前测试,它们被认为已经正确运行。

  test ./something
MIT License Copyright (c) 2022 geeknonerd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

简化版Shell部署脚本,可直接在服务器上执行. 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/geeknonerd/deploy.git
git@gitee.com:geeknonerd/deploy.git
geeknonerd
deploy
deploy
master

搜索帮助