@agilecustoms/envctl 0.27.3 → 0.28.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.
|
@@ -18,12 +18,12 @@ export class EnvApiClient {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
async createEphemeral(env) {
|
|
21
|
-
const
|
|
22
|
-
return
|
|
21
|
+
const { token } = await this.httpClient.post('/ci/env-ephemeral', env);
|
|
22
|
+
return token;
|
|
23
23
|
}
|
|
24
24
|
async create(env) {
|
|
25
|
-
await this.httpClient.post('/ci/env', env);
|
|
26
|
-
return { ...env, ephemeral: false, status: EnvStatus.Deploying };
|
|
25
|
+
const { ttl } = await this.httpClient.post('/ci/env', env);
|
|
26
|
+
return { ...env, ephemeral: false, status: EnvStatus.Deploying, ttl };
|
|
27
27
|
}
|
|
28
28
|
async setVars(env, vars) {
|
|
29
29
|
await this.httpClient.post(`/ci/env/${env.key}/vars`, vars);
|
|
@@ -34,8 +34,8 @@ export class EnvApiClient {
|
|
|
34
34
|
env.status = EnvStatus.Active;
|
|
35
35
|
}
|
|
36
36
|
async lockForUpdate(env) {
|
|
37
|
-
const
|
|
38
|
-
env.status =
|
|
37
|
+
const { status } = await this.httpClient.post(`/ci/env/${env.key}/lock-for-update`);
|
|
38
|
+
env.status = status;
|
|
39
39
|
}
|
|
40
40
|
async delete(env) {
|
|
41
41
|
let result;
|
|
@@ -56,10 +56,10 @@ export class TerraformAdapter {
|
|
|
56
56
|
printTime() {
|
|
57
57
|
const now = new Date();
|
|
58
58
|
const utc = now.toISOString();
|
|
59
|
-
const
|
|
59
|
+
const edt = now.toLocaleString('en-US', {
|
|
60
60
|
timeZone: 'America/New_York'
|
|
61
61
|
});
|
|
62
|
-
console.log(`\nTime
|
|
62
|
+
console.log(`\nTime EDT: ${edt}, UTC: ${utc}\n`);
|
|
63
63
|
}
|
|
64
64
|
tfArgs(env, cwd) {
|
|
65
65
|
const varDefs = this.getVarDefs(cwd);
|
package/dist/service/EnvCtl.js
CHANGED
|
@@ -26,7 +26,16 @@ export class EnvCtl {
|
|
|
26
26
|
console.log(`Env ${key} does not exist`);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
const date = new Date(env.ttl * 1000);
|
|
30
|
+
const expDateTime = date.toLocaleString(undefined, {
|
|
31
|
+
month: 'short',
|
|
32
|
+
day: '2-digit',
|
|
33
|
+
hour: '2-digit',
|
|
34
|
+
minute: '2-digit',
|
|
35
|
+
second: '2-digit',
|
|
36
|
+
hour12: false,
|
|
37
|
+
});
|
|
38
|
+
console.log(`Env ${key} status: ${env.status}, expires at ${expDateTime}`);
|
|
30
39
|
if (env.kind) {
|
|
31
40
|
const kind = this.cliHelper.getKind(cwd);
|
|
32
41
|
if (env.kind !== kind) {
|