Integrating react-native-code-push into gitlab-ci.yml

822 Views Asked by At

I am trying to integrate react-native-code-push into my gitlab-cli.yml script:

image: openjdk:8-jdk #Defining the Docker Image

react-native-code-push:
  stage: react-native-code-push
  script:
    - appcenter login --token {APPCENTER_ACCESS_TOKEN_PLACEHOLDER}
    - appcenter codepush release-react -a {example.example.com}/{example-name} -d Staging
    - appcenter logout
  only:
    - dev

I am receiving the next error in my gitlab pipeline:

$ appcenter login --token APPCENTER_ACCESS_TOKEN_PLACEHOLDER
/bin/bash: line 121: appcenter: command not found

How could i handle this case, so gitlab has access to the AppCenter, can login into it, do the codepush and also logout of it.

1

There are 1 best solutions below

0
On

Solved it.

image: node:lts

stages:
  - react-native-code-push

before_script:
  - npm install -g appcenter-cli
  - yarn install

react-native-code-push:
  stage: react-native-code-push
  script:
    - appcenter login --token {APPCENTER_ACCESS_TOKEN_PLACEHOLDER}
    - appcenter codepush release-react -a example.example.com/example -d Staging
    - appcenter logout
  only:
    - dev