Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,3 @@ Tearing down Rabbitory involves selecting the global region and AWS region code
---

🤝 Developed By: Jacqueline Amherst | Zijin Gong | Laren Cozart | Mason Abruzzesse

-->create links for our names to our github overview pages
Binary file added assets/deploy-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/destroy-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/provide-custom-domain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/rabbitory-deploy-success.png
Binary file not shown.
Binary file removed assets/rabbitory-destroy-success.png
Binary file not shown.
Binary file removed assets/select-aws-region-ex.png
Binary file not shown.
Binary file removed assets/select-global-region-ex.png
Binary file not shown.
Binary file added assets/select-global-region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/select-http-or-https.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/select-region-code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 18 additions & 6 deletions cli/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import { getRegion } from "../utils/region";

const TERMINAL_WIDTH = stdout.columns || 80;
const START_MSG = "\nPreparing to setup the Rabbitory Infrastructure...\n";
const URL_WAIT_MSG = "\nWaiting for Rabbitory Control Panel to be ready...";
const RESOURCE_PROVISIONING_MSG = "\nProvisioning AWS Resources for Rabbitory...\n(This usually takes about 2-3 minutes to complete)\n";
const DNS_RECORDS_MSG = "\nCreating DNS Records...\n(This can take between 5 and 30 minutes to complete dependent on DNS record propagation)\n";
const URL_WAIT_MSG = "\nWaiting for Rabbitory Control Panel to be ready...\n(This usually takes about 3-5 minutes to complete)\n";

export const deploy = async () => {
try {
Expand All @@ -33,6 +35,8 @@ export const deploy = async () => {

const userResponse = await promptUserForCustomDomain();

console.log(RESOURCE_PROVISIONING_MSG);

await runWithSpinner(
"Setting up Rabbitory Contol Panel IAM...",
() => createRabbitoryIAM(),
Expand Down Expand Up @@ -72,22 +76,27 @@ export const deploy = async () => {
throw new Error("Rabbitory instance does not have a public IP yet.");
}
const zoneResult = await handleHostedZoneSetup(domainName, region);

console.log(DNS_RECORDS_MSG);

await runWithSpinner(
"Creating A record for apex domain...",
"Creating an A-record for apex domain...",
() => createRecord(zoneResult.hostedZoneId, domainName, ip, region),
"A record for apex domain created"
"Created A-record for apex domain"
);

await runWithSpinner(
"Creating A record for www subdomain...",
"Creating an A-record for www subdomain...",
() =>
createRecord(
zoneResult.hostedZoneId,
"www." + domainName,
ip,
region
),
"A record for www subdomain created"
"Created A-record for www subdomain"
);

await runWithSpinner(
"Waiting for DNS propagation...",
() => waitForHTTPPropagation(domainName),
Expand All @@ -101,25 +110,28 @@ export const deploy = async () => {
}

console.log(URL_WAIT_MSG);

const rabbitoryUrl = await getReadyRabbitoryUrl(
instanceId,
userResponse && `https://${userResponse.domainName}`
);

console.log(
chalk.white(
`\nThe Rabbitory Control Panel is available at: ${chalk.cyan(
`\nThe Rabbitory Control Panel is now available at: ${chalk.cyan(
rabbitoryUrl
)}\n`
)
);

console.log(formatLogo(TERMINAL_WIDTH));
} catch (error) {
console.error(
chalk.redBright("\nRabbitory deployment failed\n"),
error,
"\n"
);

console.log("Rolling back your deployment...");
await destroy();
console.log("\nDeployment successfully rolled back.");
Expand Down
3 changes: 3 additions & 0 deletions cli/commands/destroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { promptUserForRegionCode } from "../utils/promptUserForAWSRegion";
import chalk from "chalk";

const START_MSG = '\nPreparing to teardown the Rabbitory Infrastructure...\n';
const TEAR_DOWN_MSG = "\nDestroying AWS Resources for Rabbitory...\n(This usually takes about 3-5 minutes to complete)\n"
const COMPLETE_MSG = `\nRabbitory infrastructure teardown complete.\nAll Rabbitory AWS services and resources have been removed.\n`

export const destroy = async () => {
Expand All @@ -18,6 +19,8 @@ export const destroy = async () => {

await promptUserForRegionCode();

console.log(TEAR_DOWN_MSG);

await runWithSpinner("Deleting DynamoDB Table...", () => deleteTable(), "Deleted DynamoDB Table");
await runWithSpinner("Terminating Control Panel EC2 instance...", () => deleteControlPanel(), "Terminated EC2 instance");
await runWithSpinner("Deleting RabbitMQ Broker Instances...", () => deleteAllBrokerInstances(), "Deleted RabbitMQ Broker Instances");
Expand Down
2 changes: 1 addition & 1 deletion cli/utils/promptUserForDomain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const promptUserForCustomDomain =
]);

if (useResponse.deploymentMethod === defaultPublicIP) {
console.log("\nProceeding with default public IP setup...\n");
console.log("\nProceeding with default public IP setup...");
return null;
}

Expand Down