Skip to content

Commit a4d30b2

Browse files
committed
testing
1 parent b61c933 commit a4d30b2

File tree

3 files changed

+41
-10
lines changed

3 files changed

+41
-10
lines changed

infrastructure/environments/derived-variables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export const derivedVariables = [
149149
{
150150
name: 'RESTORE_ENVIRONMENT_NAME',
151151
valueLabel: 'RESTORE_ENVIRONMENT_NAME',
152-
valueType: 'SECRET',
152+
valueType: 'VARIABLE',
153153
type: 'disabled',
154154
scope: 'ENVIRONMENT'
155155
},

infrastructure/environments/questions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const notEmpty = (value: string | number) =>
77

88
export const environmentQuestions = [
99
{
10-
name: 'type',
10+
name: 'environment_type',
1111
type: 'select' as const,
1212
scope: 'ENVIRONMENT' as const,
1313
message: 'Purpose for the environment?',

infrastructure/environments/setup-environment.ts

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,8 @@ ALL_QUESTIONS.push(
502502
)).configureRestore
503503
if (configureRestore) {
504504
const env_list_filtered = existingEnvironments.filter(env => env !== environment);
505-
restoreEnvironmentName = (await prompts(
505+
restoreEnvironmentName = (await promptAndStoreAnswer(
506+
environment,
506507
[
507508
{
508509
name: 'restoreEnvironmentName',
@@ -517,7 +518,8 @@ ALL_QUESTIONS.push(
517518
validate: (input: string) =>
518519
env_list_filtered.includes(input) ? true : 'Please select a valid environment.'
519520
}
520-
].map(questionToPrompt)
521+
],
522+
existingValues
521523
)).restoreEnvironmentName
522524
}
523525
} else {
@@ -935,10 +937,19 @@ ALL_QUESTIONS.push(
935937
),
936938
scope: 'ENVIRONMENT' as const
937939
},
938-
]
939-
940-
if (restoreEnvironmentName) {
941-
applicationServerUpdates.push({
940+
{
941+
type: 'VARIABLE' as const,
942+
name: 'LOGIN_URL',
943+
value: allAnswers.restoreEnvironmentName,
944+
didExist: findExistingValue(
945+
'LOGIN_URL',
946+
'VARIABLE',
947+
'ENVIRONMENT',
948+
existingValues
949+
),
950+
scope: 'ENVIRONMENT' as const
951+
},
952+
{
942953
type: 'VARIABLE' as const,
943954
name: 'RESTORE_ENVIRONMENT_NAME',
944955
value: answerOrExisting(restoreEnvironmentName, findExistingValue(
@@ -954,9 +965,29 @@ ALL_QUESTIONS.push(
954965
existingValues
955966
),
956967
scope: 'ENVIRONMENT' as const
968+
}
969+
]
970+
971+
// if (restoreEnvironmentName) {
972+
// applicationServerUpdates.push({
973+
// type: 'VARIABLE' as const,
974+
// name: 'RESTORE_ENVIRONMENT_NAME',
975+
// value: answerOrExisting(restoreEnvironmentName, findExistingValue(
976+
// 'RESTORE_ENVIRONMENT_NAME',
977+
// 'VARIABLE',
978+
// 'ENVIRONMENT',
979+
// existingValues
980+
// ), (val) => val || ''),
981+
// didExist: findExistingValue(
982+
// 'RESTORE_ENVIRONMENT_NAME',
983+
// 'VARIABLE',
984+
// 'ENVIRONMENT',
985+
// existingValues
986+
// ),
987+
// scope: 'ENVIRONMENT' as const
957988

958-
})
959-
}
989+
// })
990+
// }
960991
if (enableEncryption) {
961992
applicationServerUpdates.push({
962993
name: 'ENCRYPTION_KEY',

0 commit comments

Comments
 (0)