Skip to content

Commit de6e4ea

Browse files
chore: build dist deploy-cloud-functions (#29)
1 parent 5d58680 commit de6e4ea

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dist/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357377,6 +357377,8 @@ class CloudFunction {
357377357377
request.vpcConnector = (opts === null || opts === void 0 ? void 0 : opts.vpcConnector) ? opts.vpcConnector : null;
357378357378
request.timeout = (opts === null || opts === void 0 ? void 0 : opts.timeout) ? `${opts.timeout}s` : null;
357379357379
request.maxInstances = (opts === null || opts === void 0 ? void 0 : opts.maxInstances) ? opts.maxInstances : null;
357380+
request.availableMemoryMb = (opts === null || opts === void 0 ? void 0 : opts.availableMemoryMb) ? opts.availableMemoryMb
357381+
: null;
357380357382
// Parse env vars
357381357383
let envVars;
357382357384
if (opts === null || opts === void 0 ? void 0 : opts.envVars) {
@@ -357801,6 +357803,7 @@ function run() {
357801357803
const runtime = core.getInput('runtime', { required: true });
357802357804
const credentials = core.getInput('credentials');
357803357805
const projectId = core.getInput('project_id');
357806+
const availableMemoryMb = core.getInput('memory_mb');
357804357807
const region = core.getInput('region') || 'us-central1';
357805357808
const envVars = core.getInput('env_vars');
357806357809
const entryPoint = core.getInput('entry_point');
@@ -357820,6 +357823,7 @@ function run() {
357820357823
parent: client.parent,
357821357824
sourceDir,
357822357825
runtime,
357826+
availableMemoryMb: +availableMemoryMb,
357823357827
entryPoint,
357824357828
envVars,
357825357829
timeout,
@@ -357961,8 +357965,8 @@ exports.deleteZipFile = deleteZipFile;
357961357965
function uploadSource(uploadUrl, zipPath) {
357962357966
return __awaiter(this, void 0, void 0, function* () {
357963357967
const zipFile = fs.createReadStream(zipPath);
357964-
const client = new gaxios_1.Gaxios();
357965-
client.request({
357968+
const client = new gaxios_1.Gaxios({ retryConfig: { retry: 5 } });
357969+
const resp = yield client.request({
357966357970
method: 'PUT',
357967357971
body: zipFile,
357968357972
url: uploadUrl,
@@ -357971,6 +357975,9 @@ function uploadSource(uploadUrl, zipPath) {
357971357975
'x-goog-content-length-range': '0,104857600',
357972357976
},
357973357977
});
357978+
if (resp.status != 200) {
357979+
throw new Error(`Failed to upload function source code: ${resp.statusText}`);
357980+
}
357974357981
return uploadUrl;
357975357982
});
357976357983
}

0 commit comments

Comments
 (0)