Skip to content

bundle: command not found #38

Description

@Islemtlb

I started using mobiledevops docker image in gitlab-ci script as follows

`image: mobiledevops/flutter-sdk-image:3.16.4

variables:
ANDROID_COMPILE_SDK: "34"
ANDROID_BUILD_TOOLS: "33.0.3"
ANDROID_SDK_TOOLS: "31.3.13"

stages:

  • build
  • versionning
  • push_gitlab

flutter_build_dev:
stage: build
before_script:

- flutter clean
- flutter packages get

script:
- flutter build apk -t lib/main_dev.dart --flavor dev
artifacts:
paths:
- build/app/outputs/flutter-apk/app-dev-release.apk
except:
- main
tags:
- high

flutter_build_prod:
stage: build
before_script:
- flutter clean
- flutter packages get
script:
- flutter build apk -t lib/main_prod.dart --flavor prod
artifacts:
paths:
- build/app/outputs/flutter-apk/app-prod-release.apk
except:
- main
when: manual
tags:
- high

flutter_release_dev:
stage: build
image: mobiledevops/flutter-sdk-image:3.16.4
before_script:
- flutter clean
- flutter packages get
- cd android/
- export BUNDLE_GEMFILE=${pwd}/GemFile
- bundle install
- fastlane install_plugins
- bundle exec fastlane bump_patch
- cd ..
script:
- flutter build apk --obfuscate --split-debug-info=/bore/debug-info -t lib/main_dev.dart --flavor dev
artifacts:
paths:
- build/app/outputs/flutter-apk/app-dev-release.apk
- version_dev.yml
- pubspec.yaml
only:
- fix/pipeline
tags:
- high

flutter_release_prod:
image : mobiledevops/flutter-sdk-image:3.16.4
stage: build
before_script:
- flutter clean
- flutter packages get
- cd android/
- export BUNDLE_GEMFILE=${pwd}/GemFile
- bundle install
- fastlane install_plugins
- bundle exec fastlane bump_patch
- cd ..
script:
- flutter build apk --obfuscate --split-debug-info=/bore/debug-info -t lib/main_prod.dart --flavor prod
artifacts:
paths:
- build/app/outputs/flutter-apk/app-prod-release.apk
- version_prod.yml
- pubspec.yaml
only:
- fix/pipeline
when: manual
tags:
- high

flutter_versionning_dev:

dependencies:
- flutter_release_dev
stage: versionning
image : mobiledevops/flutter-sdk-image:3.16.4
before_script:
- cd android/
- export BUNDLE_GEMFILE=${pwd}/GemFile
- bundle install
- fastlane install_plugins
script:
- bundle update fastlane
- bundle exec fastlane android_dev_app
- bundle exec fastlane dev_slack_message
only:
- fix/pipeline
tags:
- high

flutter_versionning_prod:
dependencies:
- flutter_release_prod
stage: versionning
image : mobiledevops/flutter-sdk-image:3.16.4
before_script:
- cd android/
- export BUNDLE_GEMFILE=${pwd}/GemFile
- bundle install
- fastlane install_plugins
script:
- bundle update fastlane
- bundle exec fastlane android_prod_app
- bundle exec fastlane prod_slack_message
only:
- fix/pipeline
when: manual
tags:
- high

update_gitlab_after_dev_release:
stage: "push_gitlab"
image : mobiledevops/flutter-sdk-image:3.16.4
dependencies:
- flutter_release_dev
before_script:
- flutter clean
script:
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- git status
- git add version_dev.yml
- git add pubspec.yaml
- export MAJOR=$(yq e '.major' version_dev.yml)
- export MINOR=$(yq e '.minor' version_dev.yml)
- export PATCH=$(yq e '.patch' version_dev.yml)
- git commit -m "RELEASE ${MAJOR}.${MINOR}.${PATCH}"
- git push https://${GITLAB_USER_LOGIN}:${PUSH_ACCESS_TOKEN}@gitlab.infra.wecraft.tn/wecraft/bore/front/app-mobile.git HEAD:main -o ci.skip
only:
refs:
- fix/pipeline

update_gitlab_after_prod_release:
stage: "push_gitlab"
image : mobiledevops/flutter-sdk-image:3.16.4
dependencies:
- flutter_release_prod
before_script:
- flutter clean

script:
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- git status
- git add version_prod.yml
- git add pubspec.yaml
- export MAJOR=$(yq e '.major' version_prod.yml)
- export MINOR=$(yq e '.minor' version_prod.yml)
- export PATCH=$(yq e '.patch' version_prod.yml)
- git commit -m "RELEASE ${MAJOR}.${MINOR}.${PATCH}"
- git push https://${GITLAB_USER_LOGIN}:${PUSH_ACCESS_TOKEN}@gitlab.com/wecraft.tn/projects/bore/front/app-mobile.git HEAD:main -o ci.skip
only:
refs:
- fix/pipeline
when: manual`

Expected behaviour

pipeline should succeed

Actual behaviour

pipeline fails and I get this error :

$ cd android/
$ export BUNDLE_GENFILE=${pwd}/GemFile
$ bundle install
/scripts-55-24066/step_script: line 165: bundle: command not found

Cleaning up project directory and file based variables
00:00
ERROR: Job failed: command terminated with exit code 1
I tried few fixes but nothing worked for me could you include bundler in your dockerfile? or if there's any other solution I'll be grateful . Happy coding

system used

  • macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions