Android CI/CD AWS 上的管道

Android CI/CD pipeline on AWS

我正在关注这个 AWS Android CI/CD pipeline guide。构建成功,但工件未上传到 S3。

我的buildspec.yml:

version: 0.2
phases:
  build:
    commands:
      - ./gradlew assembleDebug
artifacts:
  files:
    - app/build/outputs/apk/app-debug.apk

错误:

BUILD SUCCESSFUL in 2m 1s
30 actionable tasks: 30 executed
[Container] 2021/04/26 11:36:29 Phase complete: BUILD State: SUCCEEDED
[Container] 2021/04/26 11:36:29 Phase context status code:  Message: 
[Container] 2021/04/26 11:36:29 Entering phase POST_BUILD
[Container] 2021/04/26 11:36:29 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2021/04/26 11:36:29 Phase context status code:  Message: 
[Container] 2021/04/26 11:36:30 Expanding base directory path: .
[Container] 2021/04/26 11:36:30 Assembling file list
[Container] 2021/04/26 11:36:30 Expanding .
[Container] 2021/04/26 11:36:30 Expanding file paths for base directory .
[Container] 2021/04/26 11:36:30 Assembling file list
[Container] 2021/04/26 11:36:30 Expanding app/build/outputs/
[Container] 2021/04/26 11:36:30 Phase complete: UPLOAD_ARTIFACTS State: FAILED
[Container] 2021/04/26 11:36:30 Phase context status code: CLIENT_ERROR Message: no matching artifact paths found

我已经创建了 S3 存储桶并添加了存储桶名称和路径,如下图所示。

存储桶权限:

{
    "Version": "2012-10-17",
    "Id": "Policy1619425519087",
    "Statement": [
        {
            "Sid": "Stmt1619425507980",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::816888571071:user/salahuddin"
            },
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::chiragh-andriod"
        }
    ]
}

构建位置是否正确?我在构建管道的输出中看到 [Container] 2021/04/26 11:36:30 Expanding app/build/outputs/,而工件引用 app/build/outputs/apk/app-debug.apk。如果您想知道此位置的路径,可以在构建期间 运行 $CODEBUILD_SRC_DIR