diff --git a/node/src/commands/deploy.js b/node/src/commands/deploy.js index dc1e172..342fc46 100644 --- a/node/src/commands/deploy.js +++ b/node/src/commands/deploy.js @@ -2,7 +2,7 @@ const DeployUtils = require('../lib/deploy-utils'); const logger = require('../lib/logger'); const { options } = require('../config/constants'); -const { BLUEPRINT_ID, ENVIRONMENT_NAME, PROJECT_ID, WORKSPACE_NAME } = options; +const { BLUEPRINT_ID, WORKSPACE_NAME } = options; const assertBlueprintExistsOnInitialDeployment = options => { if (!options[BLUEPRINT_ID]) throw new Error('Missing blueprint ID on initial deployment'); @@ -26,7 +26,7 @@ const deploy = async (options, variables) => { const configurationChanges = getConfigurationChanges(variables); let deployment; - let environment = await deployUtils.getEnvironment(options[ENVIRONMENT_NAME], options[PROJECT_ID]); + let environment = await deployUtils.getEnvironment(options); if (!environment) { logger.info('Initial deployment detected!'); diff --git a/node/src/commands/destroy.js b/node/src/commands/destroy.js index 1d5a70a..4d8c2f1 100644 --- a/node/src/commands/destroy.js +++ b/node/src/commands/destroy.js @@ -3,7 +3,7 @@ const { options } = require('../config/constants'); const _ = require('lodash'); const { convertStringToBoolean, removeEmptyValuesFromObj } = require('../lib/general-utils'); -const { PROJECT_ID, ENVIRONMENT_NAME, REQUIRES_APPROVAL, SKIP_STATE_REFRESH } = options; +const { ENVIRONMENT_NAME, REQUIRES_APPROVAL, SKIP_STATE_REFRESH } = options; const assertEnvironmentExists = environment => { if (!environment) { @@ -14,7 +14,7 @@ const assertEnvironmentExists = environment => { const destroy = async options => { const deployUtils = new DeployUtils(); - const environment = await deployUtils.getEnvironment(options[ENVIRONMENT_NAME], options[PROJECT_ID]); + const environment = await deployUtils.getEnvironment(options); let status; assertEnvironmentExists(environment); diff --git a/node/src/lib/set-deployment-approval-status.js b/node/src/lib/set-deployment-approval-status.js index 468d3b4..8396c33 100644 --- a/node/src/lib/set-deployment-approval-status.js +++ b/node/src/lib/set-deployment-approval-status.js @@ -4,7 +4,7 @@ const logger = require('../lib/logger'); const setDeploymentApprovalStatus = (command, shouldProcessDeploymentSteps) => async options => { const deployUtils = new DeployUtils(); - const environment = await deployUtils.getEnvironment(options.environmentName, options.projectId); + const environment = await deployUtils.getEnvironment(options); if (!environment) { throw new Error(`Could not find an environment with the name ${options.environmentName}`);