【问题标题】:AWS Elastic Beanstalk .ebextensions not being called in in buildspec.ymlAWS Elastic Beanstalk .ebextensions 未在 buildspec.yml 中调用
【发布时间】:2020-08-17 19:55:33
【问题描述】:

我的.ebextensions 中有多个.config 文件时遇到问题。我的buildspec.yml 看起来像这样:

version: 0.2

artifacts:
    files:
      - .ebextensions/**/*
phases:
  install: 
    runtime-versions:
      php: 7.4
  build:
    commands:
    - echo Build started on `date`
    - echo installing composer..
    - composer install --no-interaction --prefer-dist
  post_build:
    commands:
      - echo Build completed on `date`
      - echo Pushing the Docker image...

在 AWS CodeBuild 中,我的管道不断中断,因为 composer 正在尝试安装像 ffmpeglibz 这样的软件包,这些软件包在我的 .ebextensions 中指定,但从未被调用。

我的输出如下所示:

[Container] 2020/05/03 12:19:49 Waiting for agent ping
[Container] 2020/05/03 12:19:51 Waiting for DOWNLOAD_SOURCE
[Container] 2020/05/03 12:20:11 Phase is DOWNLOAD_SOURCE
[Container] 2020/05/03 12:20:11 CODEBUILD_SRC_DIR=/codebuild/output/src119370068/src
[Container] 2020/05/03 12:20:11 YAML location is /codebuild/output/src119370068/src/buildspec.yml
[Container] 2020/05/03 12:20:11 No commands found for phase name: install
[Container] 2020/05/03 12:20:11 Processing environment variables
[Container] 2020/05/03 12:20:12 Selecting 'php' runtime version '7.4' based on manual selections...
[Container] 2020/05/03 12:20:12 Running command echo "Installing PHP version 7.4 ..."
Installing PHP version 7.4 ...

[Container] 2020/05/03 12:20:12 Running command phpenv global $PHP_74_VERSION
7.4.1

[Container] 2020/05/03 12:20:15 Moving to directory /codebuild/output/src119370068/src
[Container] 2020/05/03 12:20:15 Registering with agent
[Container] 2020/05/03 12:20:15 Phases found in YAML: 3
[Container] 2020/05/03 12:20:15  INSTALL: 0 commands
[Container] 2020/05/03 12:20:15  BUILD: 9 commands
[Container] 2020/05/03 12:20:15  POST_BUILD: 2 commands
[Container] 2020/05/03 12:20:15 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED
[Container] 2020/05/03 12:20:15 Phase context status code:  Message: 
[Container] 2020/05/03 12:20:15 Entering phase INSTALL
[Container] 2020/05/03 12:20:15 Phase complete: INSTALL State: SUCCEEDED
[Container] 2020/05/03 12:20:15 Phase context status code:  Message: 
[Container] 2020/05/03 12:20:15 Entering phase PRE_BUILD
[Container] 2020/05/03 12:20:15 Phase complete: PRE_BUILD State: SUCCEEDED
[Container] 2020/05/03 12:20:15 Phase context status code:  Message: 
[Container] 2020/05/03 12:20:15 Entering phase BUILD
[Container] 2020/05/03 12:20:15 Running command echo Build started on `date`
Build started on Sun May 3 12:20:15 UTC 2020

[Container] 2020/05/03 12:20:15 Running command echo installing composer..
installing composer..

它正在安装composer,但从未安装ebextensions。我做错了什么?

【问题讨论】:

    标签: php amazon-web-services amazon-elastic-beanstalk aws-codepipeline


    【解决方案1】:

    CodeBuild 不理解“ebextensions”。此目录仅对 Elastic Beanstalk 命令处理器很重要。

    对于 CodeBuild,请在构建规范中手动运行安装命令。

    【讨论】:

      猜你喜欢
      • 2018-06-05
      • 2020-07-24
      • 2020-08-27
      • 2016-12-21
      • 2020-02-28
      • 2015-01-04
      • 2017-08-04
      • 2015-12-09
      • 2013-12-20
      相关资源
      最近更新 更多