无法使用Bitbucket管道部署到EB

时间:2018-02-21 12:26:56

标签: python amazon-web-services elastic-beanstalk bitbucket-pipelines

我们已经建立了非常好的管道脚本。最近,我们决定使用bitbucket管道自动部署到弹性beanstalk,并遵循使用命令eb deploy进行部署的教程。显然,此命令在管道上失败。配置文件似乎是合法的,因为它在本地运行。它还从我们在管道文件中指定的同一图像的容器内部运行,也可以使用本地的docker exec在同一图像的容器内运行命令。以下是管道文件以及使用eb deploy --verbose命令获得的错误。我显然在这里遗漏了一些东西。任何帮助或方向将不胜感激。提前感谢你。

feature/KKLT-1065-deploy-via-pipelines:
  - step:
      deployment: staging
      caches:
        - composer
      script:
        - php -r "file_exists('.env') || copy('.env.example', '.env');"
        - cat .env
        - composer install
        - php artisan cache:clear
        - php artisan migrate
        - php artisan db:seed
        - eb init KMLT-staging-ttl -r eu-central-1 -p "64bit Amazon Linux 2017.09 v2.6.4 running PHP 7.1"
        - eb deploy --verbose
      services:
        - postgres
+ eb deploy --verbose
INFO: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ebcli/core/ebrun.py", line 41, in run_app
    app.run()
  File "/usr/lib/python2.7/site-packages/cement/core/foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "/usr/lib/python2.7/site-packages/cement/core/controller.py", line 472, in _dispatch
    return func()
  File "/usr/lib/python2.7/site-packages/cement/core/controller.py", line 475, in _dispatch
    self._parse_args()
  File "/usr/lib/python2.7/site-packages/cement/core/controller.py", line 452, in _parse_args
    self.app._parse_args()
  File "/usr/lib/python2.7/site-packages/cement/core/foundation.py", line 1076, in _parse_args
    for res in self.hook.run('post_argument_parsing', self):
  File "/usr/lib/python2.7/site-packages/cement/core/hook.py", line 150, in run
    res = hook[2](*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ebcli/core/hooks.py", line 35, in pre_run_hook
    set_profile(app.pargs.profile)
  File "/usr/lib/python2.7/site-packages/ebcli/core/hooks.py", line 47, in set_profile
    profile = commonops.get_default_profile()
  File "/usr/lib/python2.7/site-packages/ebcli/operations/commonops.py", line 973, in get_default_profile
    profile = get_config_setting_from_branch_or_default('profile')
  File "/usr/lib/python2.7/site-packages/ebcli/operations/commonops.py", line 1008, in get_config_setting_from_branch_or_default
    setting = get_setting_from_current_branch(key_name)
  File "/usr/lib/python2.7/site-packages/ebcli/operations/commonops.py", line 991, in get_setting_from_current_branch
    branch_name = source_control.get_current_branch()
  File "/usr/lib/python2.7/site-packages/ebcli/objects/sourcecontrol.py", line 184, in get_current_branch
    stdout, stderr, exitcode = self._run_cmd(revparse_command, handle_exitcode=False)
  File "/usr/lib/python2.7/site-packages/ebcli/objects/sourcecontrol.py", line 480, in _run_cmd
    stdout, stderr, exitcode = exec_cmd(cmd)
  File "/usr/lib/python2.7/site-packages/cement/utils/shell.py", line 40, in exec_cmd
    proc = Popen(cmd_args, *args, **kw)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
INFO: OSError - [Errno 2] No such file or directory

1 个答案:

答案 0 :(得分:1)

尝试使用python3版本的eb而不是python2.7。可能会有更多的成功。

相关问题