【问题标题】:AWS CodeBuild Skipping invalid artifact path - not a valid identifierAWS CodeBuild 跳过无效的工件路径 - 不是有效的标识符
【发布时间】:2018-07-23 01:27:17
【问题描述】:

我有一个处理两个项目的 AWS CodeBuild,在构建过程中,源代码将被构建并捆绑在 zip 文件中并放置在 bundles/* 中。

以下是目录树的样子,其中 bundles 包含要部署的生成的 zip 文件:

它使用以下buildspec.yml

version: 0.2

phases:
  install:
    commands:
      - ./manager.sh install
  build:
    commands:
      - ./manager.sh build
      - ./manager.sh package
      - ./manager.sh test
      - ./manager.sh test:functional
      - ./manager.sh test:deploy
  post_build:
    commands:
      - ls -l bundles # I see the artifacts on the console using this

artifacts:
  files: 
    - 'bundles/*'

测试后,构建通过后部署失败。

这会返回Skipping invalid artifact path [edited] not a valid identifier .(应该是捆绑包)

我尝试了以下多种组合:

这个返回Skipping invalid artifact path [edited] not a valid identifier bundles

artifacts:
  base-directory: bundles
  files: 
    - '**/*'

或者这个Skipping invalid artifact path [edited] not a valid identifier .

artifacts:
  files: 
    - bundles

这是完整的错误:

[Container] 2018/02/12 19:13:05 Expanding /codebuild/output/tmp/env.sh: line 69: export: `npm_config_unsafe-perm': not a valid identifier
.
[Container] 2018/02/12 19:13:05 Skipping invalid artifact path /codebuild/output/tmp/env.sh: line 69: export: `npm_config_unsafe-perm': not a valid identifier
.
[Container] 2018/02/12 19:13:05 Phase complete: UPLOAD_ARTIFACTS Success: false
[Container] 2018/02/12 19:13:05 Phase context status code: CLIENT_ERROR Message: No matching base directory path found for /codebuild/output/tmp/env.sh: line 69: export: `npm_config_unsafe-perm': not a valid identifier
.
[Container] 2018/02/12 19:13:07 Runtime error (*errors.errorString: No matching base directory path found for /codebuild/output/tmp/env.sh: line 69: export: `npm_config_unsafe-perm': not a valid identifier
.)

可以是我的docker container吗?

【问题讨论】:

    标签: amazon-web-services yaml aws-codebuild


    【解决方案1】:

    我尝试了多种方法,但都失败了,所以我唯一的领先优势是:

    line 69: export: `npm_config_unsafe-perm'
    

    多次出现。这些行来自我的 docker 图像。所以我认为 可能 aws codebuild 出于某种原因对该错误进行了误报。

    我将我的图片从 lambci/lambda:build-nodejs6.10 更改为 roelofr/node-zip:latest 进行快速测试,结果发现它没有任何问题。

    所以,一个 Docker 映像可能会破坏您的构建,即使其余部分都很好,请注意

    所以我会将图像更改为个人图像,使用node 6.10.3 仅用于验证目的。

    【讨论】:

      猜你喜欢
      • 2021-08-09
      • 1970-01-01
      • 2015-08-24
      • 2017-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多