Whether you are bare or managed workflow - Managed
Your eas-cli
version - 0.47.0
We have an existing Github repo that contains backend code for our application. We added the React-App folder as a sub folder in this repo which contains all our react code. When we go to build (eas build) our entire repo is uploaded every time which takes a while when it should only be uploading the folder our react code lives. Is there a way to specify to eas build that it should only be uploading a particular folder and not the whole repo?
I recommend keeping that separate, but you can add .easignore in root of the repo and add their stuff you don’t want to upload (plus whatever you have in gitignore)
# How projects are uploaded to EAS Build
When you run `eas build`, we need to get your source code from your development machine to one of our macOS or Linux build workers. In order to do this, EAS CLI will collect and compress project files into a single archive, and then upload that archive to private cloud storage that is accessible only to the build worker. By default, EAS CLI will produce the archive by copying all files starting from the root of the git repository with the exception of `.git`, `node_modules`, and all files matched by rules from `.gitignore` (or `.easignore` if it exists).
> `.easignore` supports [the same path patterns as `.gitignore` files](http://git-scm.com/docs/gitignore), but it can only be located in the root of your git repository and, if it is present, none of the existing `.gitignore` files will be respected by EAS CLI.
## What files are included in the archive?
You likely do not want to upload your `node_modules` directory, or maybe you have a `.env` file that is ignored by source control. EAS CLI always respects `.gitignore` files, but depending on your configuration there might be certain edge cases where EAS behavior is not 100% compliant with git.
You can run `eas build:inspect --platform [ios|android] --stage archive --output ~/target/output/path --profile production` and inspect the output directory (in this case `~/target/output/path`) to see which files are included.
#### EAS CLI
By default, or if you set the `EAS_NO_VCS` environment variable, EAS CLI will use its own packaging algorithm that approximates `git clone --depth 1 ...` and allows you to build with a dirty git working tree. The following limitations apply when using this approach:
- If you have multiple `.gitignore` files, they are applied in isolation starting from the root, so if you have an ignore rule like `test/example` in the parent directory and `!example/example1` in the `test` directory then the entire `example` directory will still be ignored.
- The `node_modules` directory is ignored by default.
- Even if you are using `git-crypt`, all the files are uploaded as they are in your project directory. This means all sensitive files could be uploaded to EAS Build in a non-encrypted state.
- The `.git` directory is not uploaded to EAS Build. So if you are using any tools that depend on the state of the Git repository, this might result in unexpected behavior (e.g. sentry reads the commit hash when uploading the source maps).
- The content of the submodules will be included as they are in your working directory.
This file has been truncated. show original
note that if easignore is present non of the gitignore files are respected(including in subdirectories) and easignore can only be palced in the root directory
2 Likes
system
Closed
April 11, 2022, 1:49pm
3
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.