-
Notifications
You must be signed in to change notification settings - Fork 1k
Init flow demo #6218
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
Merged
Merged
Init flow demo #6218
Changes from 30 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
4147110
testing
svnsairam 1c025f1
testing
svnsairam 4b3e805
Init demo flow
svnsairam 2fac766
Create Stack request body changed
svnsairam cefe927
Merge remote-tracking branch 'origin/master' into svnsairam-fsk-001
svnsairam 90af159
Merge branch 'svnsairam-fsk-001' of https://github.com/firebase/fireb…
svnsairam a540248
Merge remote-tracking branch 'origin/master' into svnsairam-fsk-001
svnsairam 18bc06c
Merge remote-tracking branch 'origin/master' into svnsairam-fsk-001
svnsairam 1609091
Updated CRUD API's for stacks
svnsairam 7c8b3e3
Updated changes
svnsairam 64337b1
updated comments
svnsairam a73bfd6
Update CRUD options
svnsairam cc028c7
Merge remote-tracking branch 'origin/master' into svnsairam-fsk-001
svnsairam a956766
Merge branch 'master' into svnsairam-fsk-001
svnsairam 9e58710
resolved comments
svnsairam 4e43d68
resolved comments
svnsairam 285d148
resolved comments
svnsairam 76e0c6d
Merge remote-tracking branch 'origin/master' into svnsairam-fsk-001
svnsairam af5db62
Changing stack to backend in APIs
svnsairam f3bdc35
Added changes to modify api
svnsairam c8c3ce9
minor change to region
svnsairam 9781527
Added error messages
svnsairam 0243f7f
Merge branch 'master' into svnsairam-fsk-001
svnsairam efe259b
Merge branch 'master' into svnsairam-fsk-001
svnsairam d44fb6d
catch block added
svnsairam 5d48639
Merge branch 'svnsairam-fsk-001' of https://github.com/firebase/fireb…
svnsairam b30ee48
Added few changes
svnsairam 333d8f8
Merge branch 'master' into svnsairam-fsk-001
svnsairam 5d008dd
Merge branch 'master' into svnsairam-fsk-001
svnsairam 56d8a12
Merge branch 'master' into svnsairam-fsk-001
svnsairam 7b80e73
Returned stack
svnsairam fcf5708
Return stack
svnsairam d992188
Added return statements
svnsairam 8f942aa
Removed comments
svnsairam 8db5e15
changed comments
svnsairam fdeda7c
Added minor change
svnsairam b5e7cf9
Merge branch 'master' into svnsairam-fsk-001
svnsairam 71d534c
Format code
svnsairam 681a695
Format code
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Command } from "../command"; | ||
import { Options } from "../options"; | ||
import { needProjectId } from "../projectUtils"; | ||
import requireInteractive from "../requireInteractive"; | ||
import { doSetup } from "../init/features/frameworks"; | ||
|
||
export const command = new Command("stacks:create") | ||
.description("Create a stack in a Firebase project") | ||
.before(requireInteractive) | ||
.action(async (options: Options) => { | ||
const projectId = needProjectId(options); | ||
await doSetup(options, projectId); | ||
}); |
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,42 @@ | ||
import { Command } from "../command"; | ||
import { Options } from "../options"; | ||
import { needProjectId } from "../projectUtils"; | ||
import { FirebaseError } from "../error"; | ||
import * as gcp from "../gcp/frameworks"; | ||
import { promptOnce } from "../prompt"; | ||
import * as utils from "../utils"; | ||
|
||
export const command = new Command("stacks:delete") | ||
.description("Delete a stack from a Firebase project") | ||
.option("-l, --location <location>", "Stack backend location", "us-central1") | ||
.option("-s, --stackId <stackId>", "Stack backend location", "") | ||
.withForce() | ||
.action(async (options: Options) => { | ||
const projectId = needProjectId(options); | ||
const location = options.location as string; | ||
const stackId = options.stackId as string; | ||
svnsairam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (!stackId) { | ||
throw new FirebaseError("Stack id can't be empty."); | ||
} | ||
const confirmDeletion = await promptOnce( | ||
{ | ||
type: "confirm", | ||
name: "force", | ||
default: false, | ||
message: "You are about to delete the Stack with id: " + stackId + "\n Are you sure?", | ||
}, | ||
options | ||
); | ||
if (!confirmDeletion) { | ||
throw new FirebaseError("Deletion aborted."); | ||
} | ||
|
||
try { | ||
await gcp.deleteStack(projectId, location, stackId); | ||
utils.logSuccess(`Successfully deleted the stack: ${stackId}`); | ||
} catch (err) { | ||
throw new FirebaseError( | ||
`Failed to delete stack: ${stackId}. Please check the parameters you have provided.` | ||
svnsairam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
); | ||
} | ||
}); |
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,28 @@ | ||
import { Command } from "../command"; | ||
import { Options } from "../options"; | ||
import { needProjectId } from "../projectUtils"; | ||
import * as gcp from "../gcp/frameworks"; | ||
import { FirebaseError } from "../error"; | ||
import { logger } from "../logger"; | ||
|
||
export const command = new Command("stacks:get") | ||
.description("Get stack details of a Firebase project") | ||
.option("-l, --location <location>", "Stack backend location", "us-central1") | ||
.option("--s, --stackId <stackId>", "Id for the stack", "") | ||
.action(async (options: Options) => { | ||
const projectId = needProjectId(options); | ||
const location = options.location as string; | ||
const stackId = options.stackId as string; | ||
svnsairam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (!stackId) { | ||
throw new FirebaseError("Stack id can't be empty."); | ||
} | ||
|
||
try { | ||
const stack = await gcp.getStack(projectId, location, stackId); | ||
logger.info(stack); | ||
taeold marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} catch (err) { | ||
throw new FirebaseError( | ||
`Failed to get stack: ${stackId}. Please check the parameters you have provided.` | ||
svnsairam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
); | ||
} | ||
taeold marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}); |
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,23 @@ | ||
import { Command } from "../command"; | ||
import { Options } from "../options"; | ||
import { needProjectId } from "../projectUtils"; | ||
import * as gcp from "../gcp/frameworks"; | ||
import { FirebaseError } from "../error"; | ||
import { logger } from "../logger"; | ||
|
||
export const command = new Command("stacks:list") | ||
.description("List stacks of a Firebase project.") | ||
.option("-l, --location <location>", "Stack backend location", "us-central1") | ||
.action(async (options: Options) => { | ||
const projectId = needProjectId(options); | ||
const location = options.location as string; | ||
|
||
try { | ||
const stacks = await gcp.listStack(projectId, location); | ||
logger.info(stacks); | ||
svnsairam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} catch (err) { | ||
throw new FirebaseError( | ||
`Unable to list stacks present in project: ${projectId}. Please check the parameters you have provided.` | ||
); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment - please return the stacks response |
||
}); |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const DEFAULT_REGION = "us-central1"; | ||
export const ALLOWED_REGIONS = [{ name: "us-central1 (Iowa)", value: "us-central1" }]; | ||
export const ALLOWED_REGIONS = [{ name: "us-central1", value: "us-central1" }]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. q: why did we get rid of Iowa in the name? |
||
export const DEFAULT_DEPLOY_METHOD = "github"; | ||
export const ALLOWED_DEPLOY_METHODS = [{ name: "Deploy using github", value: "github" }]; |
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
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
Oops, something went wrong.
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.