Skip to content

feat(cli): disabling variable push #960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 1 addition & 35 deletions templates/cli/lib/commands/push.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ const pushSettings = async () => {
}
}

const pushFunction = async ({ functionId, async, code, withVariables } = { returnOnZero: false }) => {
const pushFunction = async ({ functionId, async, code } = { returnOnZero: false }) => {
process.chdir(localConfig.configDirectoryPath)

const functionIds = [];
Expand Down Expand Up @@ -1146,39 +1146,6 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
}
}

if (withVariables) {
updaterRow.update({ status: 'Updating variables' }).replaceSpinner(SPINNER_ARC);

const { variables } = await paginate(functionsListVariables, {
functionId: func['$id'],
parseOutput: false
}, 100, 'variables');

await Promise.all(variables.map(async variable => {
await functionsDeleteVariable({
functionId: func['$id'],
variableId: variable['$id'],
parseOutput: false
});
}));

let result = await awaitPools.wipeVariables(func['$id']);
if (!result) {
updaterRow.fail({ errorMessage: `Variable deletion timed out.` })
return;
}

// Deploy local variables
await Promise.all((func['vars'] ?? []).map(async variable => {
await functionsCreateVariable({
functionId: func['$id'],
key: variable['key'],
value: variable['value'],
parseOutput: false
});
}));
}

if (code === false) {
successfullyPushed++;
successfullyDeployed++;
Expand Down Expand Up @@ -1692,7 +1659,6 @@ push
.option(`-f, --function-id <function-id>`, `ID of function to run`)
.option(`-A, --async`, `Don't wait for functions deployments status`)
.option("--no-code", "Don't push the function's code")
.option("--with-variables", `Push function variables.`)
.action(actionRunner(pushFunction));

push
Expand Down