Skip to content

Commit

Permalink
pass options obj to get environment func
Browse files Browse the repository at this point in the history
  • Loading branch information
yaronya committed May 12, 2024
1 parent 94ab9a4 commit e1865c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions node/src/commands/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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!');
Expand Down
4 changes: 2 additions & 2 deletions node/src/commands/destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion node/src/lib/set-deployment-approval-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit e1865c3

Please sign in to comment.