Git使用子模块部署钩子ec2

时间:2013-03-20 11:24:24

标签: git node.js amazon-ec2 git-submodules supervisord

我在运行节点应用程序的aws上创建了实例。我安装了supervisord以保持节点应用程序正常运行。部署通过带有deploment hook的git进行。\

结构是这样的:

    --- root
      |
      |--repo |-- hooks
      |       |-- branches
      |       |-- etc.
      |
      |--app

post-receive hook看起来像这样。

    #!/bin/sh
    GIT_WORK_TREE=/home/ubuntu/app
    GIT_DIR=/home/ubuntu/repo
    export GIT_WORK_TREE
    export GIT_DIR

    git checkout -f

    echo 'Update sub modules.'
    git submodule init && git submodule sync && git submodule update

    echo 'Install dependencies.'
    cd $GIT_WORK_TREE && sudo rm -rf node_modules && sudo npm install

    echo 'Restart app'
    sudo supervisorctl restart node

每件事情都很好,但是我知道我开始在我的回购中使用子模块,我无法拉动模块并获得此消息。得到了这个消息:

您需要从工作树的顶层运行此命令。

我的安装基于http://cuppster.com/2011/05/12/diy-node-js-server-on-amazon-ec2/

我的配置设置

    core.repositoryformatversion=0
    core.filemode=true
    core.bare=false
    core.worktree=/home/ubuntu/app
    receive.denycurrentbranch=ignore

我该如何解决这个问题?

提前致谢!!

0 个答案:

没有答案
相关问题