mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-13 14:12:57 +00:00
Send push source packages as gzipped data
Change-type: minor Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
parent
872b17cf24
commit
cd6ee4ef5e
@ -213,6 +213,7 @@ async function cancelBuildIfNecessary(build: RemoteBuild): Promise<void> {
|
||||
async function getRequestStream(build: RemoteBuild): Promise<Stream.Duplex> {
|
||||
const path = await import('path');
|
||||
const visuals = await import('resin-cli-visuals');
|
||||
const zlib = await import('zlib');
|
||||
|
||||
const tarSpinner = new visuals.Spinner('Packaging the project source...');
|
||||
tarSpinner.start();
|
||||
@ -233,6 +234,14 @@ async function getRequestStream(build: RemoteBuild): Promise<Stream.Duplex> {
|
||||
auth: {
|
||||
bearer: build.auth,
|
||||
},
|
||||
headers: {
|
||||
'Content-Encoding': 'gzip',
|
||||
},
|
||||
body: tarStream.pipe(
|
||||
zlib.createGzip({
|
||||
level: 6,
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
const uploadSpinner = new visuals.Spinner(
|
||||
@ -240,8 +249,6 @@ async function getRequestStream(build: RemoteBuild): Promise<Stream.Duplex> {
|
||||
);
|
||||
uploadSpinner.start();
|
||||
|
||||
tarStream.pipe(post);
|
||||
|
||||
const parseStream = post.pipe(JSONStream.parse('*'));
|
||||
parseStream.on('data', () => uploadSpinner.stop());
|
||||
return parseStream as Stream.Duplex;
|
||||
|
Loading…
x
Reference in New Issue
Block a user