-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Svnsairam setup turtlestack cli #5846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
svnsairam
wants to merge
16
commits into
firebase:master
from
svnsairam:svnsairam-setup-turtlestack-cli
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0a7ea1f
Initial commit for onboarding cli flow for turtlestack
svnsairam c136a5e
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam d81afde
Onboarding CLI flow M1 demo
svnsairam 261d217
Formatted code to remove lint errors
svnsairam 50ffe93
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam fd3e227
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam 8cb9935
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam 0e575fe
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam 1814b7c
Made changes to name
svnsairam 59e065e
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam bcb1ae3
Format changes to the questions asked to user
svnsairam b0274dc
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam 0848d5f
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam 1c9ae0e
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam 96ca08c
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam 794f9e0
Merge branch 'firebase:master' into svnsairam-setup-turtlestack-cli
svnsairam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| export const DEFAULT_REGION = "us-central1"; | ||
| export const ALLOWED_REGIONS = [ | ||
| { name: "us-east1 (South California)", value: "us-east1" }, | ||
| { name: "us-east4 (Northern Virginia)", value: "us-east4" }, | ||
| { name: "us-east5 (Columbus)", value: "us-east5" }, | ||
| { name: "us-central1 (Iowa)", value: "us-central1" }, | ||
| { name: "us-central2 (Chicago, IL)", value: "us-central2" }, | ||
| { name: "us-south1 (Dallas)", value: "us-south1" }, | ||
| { name: "us-west1 (Oregon)", value: "us-west1" }, | ||
| ]; | ||
| export const DEFAULT_DEPLOY_METHOD = "github"; | ||
| export const ALLOWED_DEPLOY_METHODS = [ | ||
| { name: "Deploy using github", value: "github" }, | ||
| { name: "Deploy manual", value: "manually" }, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| import * as clc from "colorette"; | ||
| import { Options } from "../../../options"; | ||
| import { Config } from "../../../config"; | ||
| import { requirePermissions } from "../../../requirePermissions"; | ||
| import { ensure } from "../../../ensureApiEnabled"; | ||
| import * as utils from "../../../utils"; | ||
| import { logger } from "../../../logger"; | ||
| import { promptOnce } from "../../../prompt"; | ||
| import { | ||
| DEFAULT_REGION, | ||
| ALLOWED_REGIONS, | ||
| DEFAULT_DEPLOY_METHOD, | ||
| ALLOWED_DEPLOY_METHODS, | ||
| } from "./constants"; | ||
|
|
||
| /** | ||
| * Setup new Frameworkstack project. | ||
| */ | ||
| export async function doSetup(setup: any, config: Config, options: Options): Promise<void> { | ||
| const projectId = setup?.rcfile?.projects?.default; | ||
| if (projectId) { | ||
| await requirePermissions({ ...options, project: projectId }); | ||
| await Promise.all([ensure(projectId, "firebaseextensions.googleapis.com", "unused", true)]); | ||
| } | ||
| setup.frameworkstack = {}; | ||
|
|
||
| utils.logBullet("First we need a few details to create your service."); | ||
|
|
||
| await promptOnce( | ||
| { | ||
| name: "serviceName", | ||
| type: "input", | ||
| default: "acme-inc-web", | ||
| message: "Create a name for your service [1-64 characters]", | ||
| }, | ||
| setup.frameworkstack | ||
| ); | ||
|
|
||
| await promptOnce( | ||
| { | ||
| name: "regionName", | ||
svnsairam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type: "list", | ||
| default: DEFAULT_REGION, | ||
| message: | ||
| "Please select a region " + | ||
| `(${clc.yellow("info")}: Your region determines where your backend is located):\n`, | ||
| choices: ALLOWED_REGIONS, | ||
| }, | ||
| setup.frameworkstack | ||
| ); | ||
|
|
||
| utils.logSuccess(`Region set to ${setup.frameworkstack.regionName}.`); | ||
|
|
||
| logger.info(clc.bold(`\n${clc.white("===")} Deploy Setup`)); | ||
|
|
||
| await promptOnce( | ||
| { | ||
| name: "deployMethod", | ||
| type: "list", | ||
| default: DEFAULT_DEPLOY_METHOD, | ||
| message: "How do you want to deploy", | ||
| choices: ALLOWED_DEPLOY_METHODS, | ||
| }, | ||
| setup.frameworkstack | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.