Yunnane
Yunnane

Reputation: 155

Gitlab CI pipeline for iOS for Flutter project

I have errors when pushing it to the repo. Error says:

Found errors in your .gitlab-ci.yml: variables config should be a hash of key-value pairs value can be a hash

What is wrong here?

The code:

stages:
  - build_android
  - build_ios
  - run_test

variables:
  ver:
    value: "13"
    options:
      - "13"
      - "13.1"
      - "13.2"
      - "13.2.1"
      - "14.0.1"

build_android:
  stage: build_android
  script:
    - flutter build apk

build_ios:
  before_script:
    - export DEVELOPER_DIR=/Applications/Xcode_${{ver}}.app/Contents/Developer
  stage: build_ios
  script:
    - xcode-select -s $DEVELOPER_DIR
    - flutter build ios --no-codesign

run_test:
  stage: run_test
  script:
    - flutter test

Upvotes: 0

Views: 832

Answers (1)

Marcin
Marcin

Reputation: 80

The issue is with the format of the variables section in the .gitlab-ci.yml file. According to the error message, the configuration of variables should be in key-value format, but the given value is in an incorrect format.

To resolve the issue, try changing the format of the ver variable to a key-value pair, like so:

variables: ver: "13"

not: variables: ver: value: "13"

Upvotes: 1

Related Questions