【问题标题】:Android CI/CD pipeline on AWSAWS 上的 Android CI/CD 管道
【发布时间】:2021-04-28 10:18:02
【问题描述】:

我正在关注这个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"
        }
    ]
}

【问题讨论】:

    标签: android amazon-web-services sdk aws-codepipeline aws-codebuild


    【解决方案1】:

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

    【讨论】:

    • 我已经在 codebuild 步骤中配置了 Android 管道,下面提到了 buildspec.yml version: 0.2 phases: install: run-as: root commands: - apt update build: run-as: root commands: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew - fastlane beta artifacts: files: - '**/*' 我还使用 docker 镜像 vratislav/gitlab-ci-fastlane-android 成功地将 .apk 上传到了 google playstore在代码构建环境中。这个 docker 镜像已经安装了 ruby​​ 和 fastlane
    猜你喜欢
    • 2021-11-30
    • 1970-01-01
    • 1970-01-01
    • 2021-09-04
    • 2021-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多