Current behavior
When creating a new deployment with graphcool-framework deploy the resulting ./.build/build.zip file, which is uploaded to the cluster, contains itself.
There are two problems with this:
Build might never finish (because archive references itself)
Build can potentially become very big (mine was over 10GB in size)
And it's clearly visible that .build/build.zip is added to the bundle, including .build/dist/.
Expected behavior?
The absence of the entire .build folder in build.zip
Proposed solution
It seems like the error is caused during file-exclusion using globby in the bundler. Here's a reference to the line: cli/packages/graphcool-cli-core/src/commands/deploy/Bundler/Bundler.ts#L82.
Instead of '!.build' it should be '!.build/**' which excludes everything from the .build folder. I can open a PR if needed.
Issue by serratus Sunday Jan 07, 2018 at 20:17 GMT Originally opened as https://github.com/graphcool/prisma/issues/1537
Hello graphcool-team,
I've come across a weird behavior of the bundler that caused a few of my deployments to fail or grow very big (10GB
build.zip
)Versions graphcool-framework: 0.11.4 MacOS: 10.13.2 Node: 8.9
Current behavior When creating a new deployment with
graphcool-framework deploy
the resulting./.build/build.zip
file, which is uploaded to the cluster, contains itself.There are two problems with this:
Reproduction
There are two ways to see the results: Using docker, or with a debug flag (see below)
Docker
The following instructions are written with a local cluster (graphcool running on docker) in mind
Inside the docker-container:
Find the current deployment
view contents of deployment:
Here you can already see the presence of a
.build
folder So let's look inside:The
build.zip
file is included within the bundled deployment. But the contents are not readableDebug flag
The current behavior can also be observed by setting an env variable
DEBUG=bundler
when deploying:This prints the following lines:
And it's clearly visible that
.build/build.zip
is added to the bundle, including.build/dist/
.Expected behavior? The absence of the entire
.build
folder inbuild.zip
Proposed solution It seems like the error is caused during file-exclusion using
globby
in the bundler. Here's a reference to the line:cli/packages/graphcool-cli-core/src/commands/deploy/Bundler/Bundler.ts#L82
.Instead of
'!.build'
it should be'!.build/**'
which excludes everything from the.build
folder. I can open a PR if needed.Cheers