How to run within Gitlab-CI?

Following How to handle Gitlab-CI and expo build/publish ? · Issue #6639 · expo/expo · GitHub

I am not able to run expo build:ios or expo build:ios with --non-interactive successfully within Gitlab-CI.

For some reason, the metro process fail to stop the first time and all following attempt fail :

Android

[23:25:31] › Stopping Metro bundler
Error: spawn ps ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

iOS

> expo build:ios --apple-id "${EXPO_APPLE_ID}" --release-channel staging -t simulator --non-interactive

- Making sure project is set up correctly...
[23:25:43] Checking if there is a build in progress...

[23:25:47] Unable to find an existing Expo CLI instance for this directory, starting a new one...
Error: spawn ps ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

This is my .gitlab-ci.yml:

# Publish expo
staging-native:
  stage: publish-native
  script:
    - npm i
    - expo build:android --non-interactive --release-channel staging || echo skip
    - expo build:ios   --apple-id ${EXPO_APPLE_ID} -t simulator --non-interactive --release-channel staging  || echo skip
    - expo publish  --non-interactive --release-channel staging --max-workers 1  || echo skip
    - npx expo url:apk || echo skip
    - npx expo url:ipa || echo skip
    - curl -o app-${CI_COMMIT_TAG}.apk "$(npx expo url:apk --non-interactive)" || echo skip
    - curl -o app-${CI_COMMIT_TAG}.ipa "$(npx expo url:ipa --non-interactive)" || echo skip
    - ls -altr || echo skip
  only:
    - tags
  tags:
    - docker

expo diagnostics:

  Expo CLI 3.11.3 environment info:
    System:
      OS: Linux 5.3 Debian GNU/Linux 10 (buster) 10 (buster)
      Shell: 5.0.3 - /bin/bash
    Binaries:
      Node: 13.5.0 - ~/.nvm/versions/node/v13.5.0/bin/node
      npm: 6.13.4 - ~/.nvm/versions/node/v13.5.0/bin/npm
    npmPackages:
      expo: ~36.0.2 => 36.0.2 
      react: ~16.12.0 => 16.12.0 
      react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4 
    npmGlobalPackages:
      expo-cli: 3.11.3

I am still finding a way how to use the CI for continuous delivery with expo. Any idea would be much appreciated. (perhaps starts metro in the background, how ?)

By the way, why do you run expo sometimes and npx expo other times?

Doing npx expo start is equivalent to npm run start in my project since npm i was called, expo-cli is set in my devDependencies and package.json is having expo start in scripts:

{
  "scripts": {
    "start": "expo start"
  },
  "devDependencies": {
    "expo-cli": "^3.11.3"
  }
}

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.