@agilecustoms/envctl 1.20.0 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -41,7 +41,7 @@ export class EnvService extends BaseService {
|
|
|
41
41
|
logger.info(`Check if env ${key} already exists`);
|
|
42
42
|
const env = await this.envApi.get(key);
|
|
43
43
|
if (env) {
|
|
44
|
-
logger.info(`
|
|
44
|
+
logger.info(`Env ${key} status: ${env.status}`);
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
47
|
logger.info(`Env ${key} does not exist`);
|
|
@@ -73,7 +73,7 @@ export class EnvService extends BaseService {
|
|
|
73
73
|
const createEnv = { key };
|
|
74
74
|
return await this.envApi.createEphemeral(createEnv);
|
|
75
75
|
}
|
|
76
|
-
async lockTerraform(env, newEnv
|
|
76
|
+
async lockTerraform(env, newEnv) {
|
|
77
77
|
logger.info('Lock providers');
|
|
78
78
|
const res = await this.terraformAdapter.lock(newEnv);
|
|
79
79
|
if (env !== null) {
|
|
@@ -111,11 +111,9 @@ export class EnvService extends BaseService {
|
|
|
111
111
|
this.handleDeleteStatuses(env);
|
|
112
112
|
const status = env.status;
|
|
113
113
|
if (status === EnvStatus.Init || status === EnvStatus.Active) {
|
|
114
|
-
|
|
115
|
-
await this.lockTerraform(env);
|
|
116
|
-
|
|
117
|
-
logger.info('Will lock for update and run terraform apply (to update resources)');
|
|
118
|
-
}
|
|
114
|
+
const newEnv = status === EnvStatus.Init;
|
|
115
|
+
await this.lockTerraform(env, newEnv);
|
|
116
|
+
logger.info('Will lock for update and run terraform apply (to update resources)');
|
|
119
117
|
await this.envApi.lockForUpdate(env);
|
|
120
118
|
await this.runApply(env, tfArgs);
|
|
121
119
|
return;
|