cloudControl push被拒绝:无法使用stat文件

时间:2014-11-19 05:00:03

标签: php deployment cloudcontrol

我试图将我的应用程序推送到cloudControl,但它似乎没有正确运行构建过程并且一直拒绝我的推送。

这是错误:

C:\Users\Vincent\Documents\GitHub\***>cctrlapp *** push
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (10/10), 4.06 KiB | 0 bytes/s, done.
Total 10 (delta 1), reused 0 (delta 0)
remote:
remote: -----> Receiving push
remote:        Loading composer repositories with package information
remote:        Installing dependencies (including require-dev) from lock file
remote:          - Installing doctrine/lexer (v1.0)
remote:            Downloading: 100%
remote:
remote:          - Installing respect/validation (0.6.1)
remote:            Downloading: 100%
remote:
remote:          - Installing slim/slim (2.4.3)
remote:            Downloading: 100%
remote:
remote:          - Installing zendframework/zend-escaper (2.2.6)
remote:            Downloading: 100%
remote:
remote:          - Installing zf1/zend-exception (1.12.8)
remote:            Downloading: 100%
remote:
remote:          - Installing zf1/zend-session (1.12.8)
remote:            Downloading: 100%
remote:
remote:        zf1/zend-session suggests installing zf1/zend-config (Used in special situations or with special adapters)
remote:        zf1/zend-session suggests installing zf1/zend-db (Used in special situations or with special adapters)
remote:        zf1/zend-session suggests installing zf1/zend-loader (Used in special situations or with special adapters)
remote:        Generating autoload files
remote: cp: cannot stat `/srv/tmp/builddir/code/vendor': No such file or directory
remote:  !     cloudControl push rejected, failed to compile php app
remote:  !
remote: error: hook declined to update refs/heads/master
To ssh://***@cloudcontrolled.com/repository.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://***@cloudcontrolled.com/repository.git'
Command '['C:\\Program Files (x86)\\Git\\cmd\\git.exe', 'push', u'ssh://***@cloudcontrolled.com/repository.git', 'master']' returned non-zero exit status 1

现在我的项目包含以下文件:

  • /
    • 包括/
      • 供应商/
    • 的.gitignore
    • composer.json
    • composer.lock
    • 的index.php

如何正确获取post-receive hook" compile" PHP应用程序?

这是我的composer.json文件:

{
    "name": "Hello World",
    "description": "My PHP application",
    "authors": [
        {
            "name": "Vincent",
            "email": " ... @gmail.com"
        }
    ],
    "config": {
        "vendor-dir": "includes/vendor"
    },
    "require": {
        "zendframework/zend-escaper": "2.2.6",
        "respect/validation": "~0.6.1",
        "slim/slim": "~2.4.3",
        "zf1/zend-session": "1.12.8"
    }
}

1 个答案:

答案 0 :(得分:0)

这里有三个可能的问题:

  • 目录为空。 Git不跟踪空目录,因此即使它存在于您的工作目录中,它也不存在于存储库中。
  • 目录不为空,但使用.gitignore忽略。
  • 作曲家并没有在正确的位置寻找vendor指挥。 /srv/tmp/builddir/code/vendor意味着它必须存在/vendor您的/includes/vendor

它实际上可能是上述任何一种的组合。为了能够告诉我需要.gitignorecomposer.json的内容。如果我不得不下注,我的钱将是最后一个选项。

要解决空目录问题,请确保您的/.gitignore文件不以任何方式包含/includes/vendor。然后创建一个包含以下内容的/includes/vendor/.gitignore文件:

# Ignore everything in this directory
*
# Except this file
!.gitignore

要修复最新动态,请检查您的composer.json和' target-dir'在那里。有关详细信息,请参阅Composer documentation