Revert "Add maxmind license key (#12)"

This reverts commit 02beda5a40.
This commit is contained in:
Arwid Thornström
2022-12-06 13:33:30 +01:00
parent 320d3031bc
commit c7090fc1f3
3 changed files with 24 additions and 29 deletions
@@ -39,7 +39,7 @@ const getLifeCyclePolicyCommand = (stackName: string, policyFile: string) => {
return `aws ecr put-lifecycle-policy --repository-name ${stackName} --lifecycle-policy-text "${policyFile}"`;
}
const getUpdateStackCommand = (stackName: string, branch: string, templateFile: string, maxmindLicenseKey: string) => {
const getUpdateStackCommand = (stackName: string, branch: string, templateFile: string) => {
const cmd = [
`aws cloudformation update-stack --stack-name ${stackName}`,
`--template-body ${templateFile}`,
@@ -63,8 +63,7 @@ const getUpdateStackCommand = (stackName: string, branch: string, templateFile:
`ParameterKey=StaticCdnHostName,ParameterValue=${STACK_DEFAULTS.STATIC_CDN_HOSTNAME}`,
`ParameterKey=StaticCdnCertificateArn,ParameterValue=${STACK_DEFAULTS.STATIC_CDN_CERTIFICATE_ARN}`,
`ParameterKey=AwsAccessKeyParamNameEnvironment,ParameterValue=${STACK_DEFAULTS.AWS_KEY_ENVIRONMENT}`,
`ParameterKey=DatabaseSecurityGroup,ParameterValue=${STACK_DEFAULTS.DB_SECURITY_GROUP_ID}`,
`ParameterKey=MaxMindLicenseKey,ParameterValue=${maxmindLicenseKey}`,
`ParameterKey=DatabaseSecurityGroup,ParameterValue=${STACK_DEFAULTS.DB_SECURITY_GROUP_ID}`
];
return cmd.join(' ');
}
@@ -119,7 +118,7 @@ module.exports = {
hidden: false,
run: async (toolbox: GluegunMenuToolbox) => {
const { system, strings, print } = toolbox;
// Load settings
const config = await getSettings(toolbox);
if (!config) {
@@ -175,7 +174,7 @@ module.exports = {
const options = curratedStacks.map(item => {
return item.name;
});
const prompt = new AutoComplete({
name: 'testserver',
message: 'Choose a server',
@@ -191,18 +190,16 @@ module.exports = {
await system.run(getDownloadFileFromRepoCommand(config.gh_token, 'Photowall', 'photowall', 'cloudformation/ecs-service.yaml'));
const stackName = await prompt.run();
const maxmindLicenseKey = strings.trim(await system.run(`aws ssm get-parameter --with-decryption --name /maxmind/MAXMIND_LICENSE_KEY --output text --query Parameter.Value`));
const lifeCycleCommand = getLifeCyclePolicyCommand(stackName, `file://ecr-lifecycle-policy.json`);
const updateStackCommand = getUpdateStackCommand(stackName, branchName, `file://ecs-service.yaml`, maxmindLicenseKey);
const updateStackCommand = getUpdateStackCommand(stackName, branchName, `file://ecs-service.yaml`);
const shouldRun = await getConfirmation(branchName, stackName);
if (shouldRun) {
let output = await system.run(lifeCycleCommand, {cwd: '/tmp/', trim: true});
print.fancy(output);
output = await system.run(updateStackCommand, {cwd: '/tmp/', trim: true});
output = await system.run(updateStackCommand, {cwd: '/tmp/', trim: true});
print.fancy(output);
}