【问题标题】:circleci # Unable to parse YAML # mapping values are not allowed herecircleci # Unable to parse YAML # mapping values are not allowed here
【发布时间】:2019-03-02 13:18:59
【问题描述】:

我需要在CriclCi 中构建我的Android 应用程序。我刚刚找到了一个provided sample,如下:

version: 2
jobs:
  build:
    working_directory: ~/code
    docker:
      - image: circleci/android:api-25-alpha
    environment:
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
      - restore_cache:
          key: jars-{{ checksum "build.gradle" }}-{{ checksum  "app/build.gradle" }}
#      - run:
#         name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
#         command: sudo chmod +x ./gradlew
      - run:
          name: Download Dependencies
          command: ./gradlew androidDependencies
      - save_cache:
          paths:
            - ~/.gradle
          key: jars-{{ checksum "build.gradle" }}-{{ checksum  "app/build.gradle" }}
      - run:
          name: Run Tests
          command: ./gradlew lint test
      - store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ 
          path: app/build/reports
          destination: reports
      - store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
          path: app/build/test-results
      # See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples

但是,当我使用它时,CircleCi 构建失败并抱怨:

#!/bin/bash -eo pipefail
./gradlew androidDependencies
/bin/bash: ./gradlew: Permission denied
Exited with code 126

因此,我添加了以下代码并再次尝试:

  run:
         name: Chmod permissions
         command: sudo chmod +x ./gradlew

这个代码是CCI推荐的,但是这次却报错了:

#!/bin/sh -eo pipefail
# Unable to parse YAML
# mapping values are not allowed here
#  in 'string', line 13, column 16:
#               - run:
#                    ^
# 
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false

我该如何解决?

【问题讨论】:

    标签: android continuous-integration circleci-2.0


    【解决方案1】:

    我明白了,yml 文件中的缩进应该始终保持不变。 因此,run 关键字应该始终在同一列中。

    【讨论】:

      猜你喜欢
      • 2019-02-24
      • 1970-01-01
      • 1970-01-01
      • 2017-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-19
      • 2016-02-16
      相关资源
      最近更新 更多