@@ -12,7 +12,7 @@ const { proxyCreateFunctionRule, proxyCreateSiteRule, proxyListRules } = require
12
12
const { consoleVariables } = require('./console');
13
13
const { sdkForConsole } = require('../sdks')
14
14
const { functionsGet, functionsCreate, functionsUpdate, functionsCreateDeployment, functionsGetDeployment, functionsListVariables, functionsDeleteVariable, functionsCreateVariable } = require('./functions');
15
- const { sitesGet, sitesCreate, sitesUpdate, sitesCreateDeployment, sitesGetDeployment, sitesListVariables, sitesCreateVariable } = require('./sites');
15
+ const { sitesGet, sitesCreate, sitesUpdate, sitesCreateDeployment, sitesGetDeployment, sitesCreateVariable } = require('./sites');
16
16
const {
17
17
databasesGet,
18
18
databasesCreate,
@@ -1011,7 +1011,7 @@ const pushSettings = async () => {
1011
1011
}
1012
1012
}
1013
1013
1014
- const pushSite = async({ siteId, async, code, withVariables } = { returnOnZero: false }) => {
1014
+ const pushSite = async({ siteId, async, code } = { returnOnZero: false }) => {
1015
1015
process.chdir(localConfig.configDirectoryPath)
1016
1016
1017
1017
const siteIds = [];
@@ -1177,38 +1177,16 @@ const pushSite = async({ siteId, async, code, withVariables } = { returnOnZero:
1177
1177
}
1178
1178
}
1179
1179
1180
- if (withVariables) {
1181
- updaterRow.update({ status: 'Updating variables' }).replaceSpinner(SPINNER_ARC);
1180
+ updaterRow.update({ status: 'Creating variables' }).replaceSpinner(SPINNER_ARC);
1182
1181
1183
- const { variables } = await paginate(sitesListVariables, {
1182
+ await Promise.all((site['vars'] ?? []).map(async variable => {
1183
+ await sitesCreateVariable({
1184
1184
siteId: site['$id'],
1185
+ key: variable['key'],
1186
+ value: variable['value'],
1185
1187
parseOutput: false
1186
- }, 100, 'variables');
1187
-
1188
- await Promise.all(variables.map(async variable => {
1189
- await sitesDeleteVariable({
1190
- siteId: site['$id'],
1191
- variableId: variable['$id'],
1192
- parseOutput: false
1193
- });
1194
- }));
1195
-
1196
- let result = await awaitPools.wipeVariables(site['$id']);
1197
- if (!result) {
1198
- updaterRow.fail({ errorMessage: `Variable deletion timed out.` })
1199
- return;
1200
- }
1201
-
1202
- // Deploy local variables
1203
- await Promise.all((site['vars'] ?? []).map(async variable => {
1204
- await sitesCreateVariable({
1205
- siteId: site['$id'],
1206
- key: variable['key'],
1207
- value: variable['value'],
1208
- parseOutput: false
1209
- });
1210
- }));
1211
- }
1188
+ });
1189
+ }));
1212
1190
1213
1191
if (code === false) {
1214
1192
successfullyPushed++;
@@ -2051,7 +2029,6 @@ push
2051
2029
.option(`-f, --site-id <site -id >`, `ID of site to run`)
2052
2030
.option(`-A, --async`, `Don't wait for sites deployments status`)
2053
2031
.option("--no-code", "Don't push the site's code")
2054
- .option("--with-variables", `Push site variables.`)
2055
2032
.action(actionRunner(pushSite));
2056
2033
2057
2034
push
0 commit comments