-> [0;32mChecking script version...[0m
-> [0;32mScript is up to date.[0m
Please select an option:
1) Run All			    8) prompt_for_expo_token
2) check_script_version		    9) setup_git_project_path
3) prompt_download_cicd_pipeline   10) prompt_to_add_gitlab_token
4) check_dependencies		   11) setup_app_config
5) setup_eas_project		   12) setup_automatic_versioning
6) setup_fastlane		   13) setup_manual_android_build
7) setup_google_drive		   14) Exit
1
-> [0;32mChecking script version...[0m
-> [0;32mScript is up to date.[0m
-----------------------------------------
-> [0;32mDownloading the CI/CD pipeline configuration...[0m
A .gitlab-ci.yml file already exists.
Do you want to overwrite it? (y/n):
y
-----------------------------------------
-> [0;32mChecking dependencies...[0m
-----------------------------------------
-> [0;33mInitializing EAS project...[0m
💡 The following process will configure your iOS and/or Android project to be compatible with EAS Build. These changes only apply to your local project files and you can safely revert them at any time.

[?25l[36m?[39m [1mWhich platforms would you like to configure for EAS Build?[22m [90m›[39m [90m- Use arrow-keys. Return to submit.[39m
[36m❯[39m   [36m[4mAll[39m[24m[90m[39m
    iOS[90m[39m
    Android[90m[39m
[2K[1G[32m✔[39m [1mWhich platforms would you like to configure for EAS Build?[22m [90m›[39m All
[?25h
🎉 Your project is ready to build.

- Run eas build when you are ready to create your first build.
- Once the build is completed, run eas submit to upload the app to app stores.
- Learn more about other capabilities of EAS Build: https://docs.expo.dev/build/introduction
------------------------------------------
-> [0;33mPlease enter your Apple App Store Connect Application ID (ascAppId).[0m
------------------------------------------
You can find your ascAppId in the App Store Connect dashboard under your app's App Information section.
If you do not wish to enter an ascAppId now, simply press Enter to skip.
Enter ascAppId or press Enter to skip: 4532314
-> [0;32mUpdating eas.json with ascAppId...[0m
-> [0;32mascAppId updated in eas.json.[0m
-> [0;32mAdding test build profile to eas.json...[0m
-> [0;32mAdding default path to service account key in eas.json...[0m
-----------------------------------------
-> [0;32mSetting up Fastlane for local builds...[0m
-> [0;33mGemfile already exists.[0m
Do you want to overwrite it? (y/n): n
->  [0;33mSkipping... [0m
Do you want to append Fastlane dependencies to the existing Gemfile? (y/n): n
-> [0;33mSkipping...[0m
Installing Fastlane and plugins...
Downloading Fastfile...
-----------------------------------------
-> [0;32mSetting up Google integration...[0m
-> [0;33mFor Google integration setup, you need to download the secret key json file from this link: REDACTED and place it to the root of the React Native project.[0m
Done? Press enter to continue...
-> [0;33m!!! IMPORTANT !!![0m
-> [0;33mPlease make sure to keep the secret key file secure and do not commit it to the repository.[0m
-> [0;33mAdding the file to .gitignore...[0m
google_service_key.json is already in .gitignore.
-> [0;32mGoogle integration setup completed.[0m
-> [0;33mPlease ensure the service account has access to the Google Drive folder you want to upload APKs to and to the Play Store project of your current application.[0m
-> [0;33mYou can grant access to the folder or project by explicitly sharing it with this email address:[0m
-> [0;33mREDACTED_EMAIL[0m
-> [0;32mTo upload a file to a Google Drive folder, use:[0m
-> [0;32mbundle exec fastlane upload_apk folder_id:"id_of_google_drive_folder_from_its_url" apk_path:"./path/to/apk"[0m
Press enter to continue...
-----------------------------------------
------------------------------------------
-> [0;33mPlease add your EXPO_TOKEN to the GitLab CI/CD variables.[0m
------------------------------------------
You can create an EXPO_TOKEN here: REDACTED_URL_TO_EXPO
-> [0;33mYou need to be logged in to Expo as REDACTED_NICKNAME to generate the token.[0m
Press enter to continue
-----------------------------------------
-> [0;32mSetting up the project path...[0m
Enter the name of your project - something recognizable, ideally without spaces (e.g., 'customer-app', 'balikovna'): test-project
Enter the git path to the project (e.g., for 'http://gitlab.com/glos/customer-app' the project path is glos/customer-app; please mind the slashes): glos/test-project
-> [0;32mProject path updated in .gitlab-ci.yml.[0m
-----------------------------------------
------------------------------------------
-> [0;33mPlease add your GitLab project access token to the GitLab CI/CD variables to utilize automatic build number bumps from the pipeline.[0m
------------------------------------------
-> [0;33mYou can generate the token by going to your project -> Settings -> Access Tokens[0m

-> [0;33mAdd the token with Token Name 'REDACTED_NAME', role 'maintainer' and the scopes 'read_repository' and 'write_repository'.[0m

-> [0;33mAfter adding the token, set it as a variable in the CI/CD settings in GitLab with the key 'GITLAB_ACCESS_TOKEN'.[0m
Press enter to continue...
-----------------------------------------
-> [0;32mSetting up app.json...[0m
-> [0;32mapp.json updated.[0m
-----------------------------------------
-> [0;32mSetting up automatic versioning...[0m
Automatic versioning setup completed.
-----------------------------------------
Do you want to download the script for manual Android builds? (y/n): y
-> [0;32mDownloading script for manual Android builds...[0m
-> [0;33mFeel free to adjust the script to your needs.[0m
-> [0;33mUse ./buildRelease.sh -h for help.[0m
-----------------------------------------
-> [0;33mPlease remember to make the first submission to the stores manually to setup credentials for both iOS and Android.[0m
-> [0;33mWithout this, the CI/CD pipeline builds will fail.[0m
-> [0;32mCI/CD pipeline setup is complete![0m
[0;32m
Press enter to see the summary of features...

-------------------------------------[0m
-> [0;32mCI/CD Pipeline Setup Summary:[0m
[0;32m-------------------------------------[0m
[0;33m- CI/CD Pipeline Configuration:[0m A .gitlab-ci.yml file is now configured to automate your project's build and deployment processes.
[0;33m- Node and Expo:[0m Ensured Node.js and Expo CLI are installed for using Expo in project management and builds.
[0;33m- EAS Project:[0m Setup eas.json if not present, to manage builds through Expo Application Services.
[0;33m- Fastlane:[0m Integrated Fastlane for automating tasks like app version increments, builds, and releases management.
[0;33m- Google Drive:[0m Configured Google Drive integration for APK uploads. Credentials set and .gitignore updated to secure the secret key.
[0;33m- Automatic Versioning:[0m Setup scripts for automatic version management with npm scripts and Fastlane.
[0;33m- Manual Android Build:[0m Provided a script for manual Android builds, enhancing control over build customization.
[0;33m- EXPO_TOKEN Reminder:[0m A reminder to set EXPO_TOKEN in your CI/CD environment to enable Expo services.
[0;32m-------------------------------------[0m
-> [0;32mWhat you can do now:[0m
[0;33m- CI/CD Pipeline Use:[0m Commit changes to your repository to start using the CI/CD pipeline. Example: git commit -m 'Start CI/CD'
[0;33m- Manual Builds and Versioning:[0m Use the provided scripts for version management or manual builds. Example: ./buildRelease.sh -h
[0;33m- Google Drive Upload:[0m Upload your APK directly to Google Drive via Fastlane. Example: bundle exec fastlane upload_apk folder_id:"id_of_google_drive_folder_from_its_url" apk_path:"./path/to/apk" apk_name
[0;33m- EXPO_TOKEN Configuration:[0m Ensure EXPO_TOKEN is setup to access EAS services. Go to REDACTED_URL to generate your access token and add it as a variable to the CI/CD settings in GitLab.
[0;33m- Check Google Drive Folder Access:[0m Ensure the service account has access to the folder for uploads.
[0;32m-------------------------------------[0m
-> [0;32mAdditional Tips:[0m
[0;33m- Review Configurations:[0m Tailor the .gitlab-ci.yml and Fastfile to your project needs.
[0;33m- Update Tools:[0m Keep Node.js, Expo CLI, and Fastlane updated for new features and security.
[0;33m- Verify app.json Ownership:[0m Check that 'owner' in app.json is set correctly as "owner": "INQOOL_NICKNAME".
[0;32m-------------------------------------[0m
