-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve & standlize the logger #5
Signed-off-by: seven <[email protected]>
- Loading branch information
Showing
12 changed files
with
219 additions
and
36 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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,17 +1,17 @@ | ||
import { deployStack, parseYaml } from '../stack'; | ||
import { printer, constructActionContext } from '../common'; | ||
import { constructActionContext, logger } from '../common'; | ||
|
||
export const deploy = async ( | ||
stackName: string, | ||
options: { location: string; parameters: { [key: string]: string } }, | ||
) => { | ||
const context = constructActionContext(options); | ||
printer.info('Validating yaml...'); | ||
logger.info('Validating yaml...'); | ||
const iac = parseYaml(context.iacLocation); | ||
printer.success('Yaml is valid! 🎉'); | ||
logger.info('Yaml is valid! 🎉'); | ||
|
||
printer.info('Deploying stack...'); | ||
logger.info('Deploying stack...'); | ||
await deployStack(stackName, iac, context); | ||
|
||
printer.success('Stack deployed! 🎉'); | ||
logger.info('Stack deployed! 🎉'); | ||
}; |
This file contains 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,8 +1,9 @@ | ||
import { printer, constructActionContext } from '../common'; | ||
import { constructActionContext, logger } from '../common'; | ||
import { parseYaml } from '../stack'; | ||
|
||
export const validate = (location?: string) => { | ||
const context = constructActionContext({ location }); | ||
parseYaml(context.iacLocation); | ||
printer.success('Yaml is valid! 🎉'); | ||
logger.info('Yaml is valid! 🎉'); | ||
logger.debug('Yaml is valid! debug🎉'); | ||
}; |
This file contains 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,3 @@ | ||
export * from './printer'; | ||
export * from './provider'; | ||
export * from './logger'; | ||
export * from './getVersion'; | ||
|
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 |
---|---|---|
|
@@ -9,6 +9,8 @@ vars: | |
stages: | ||
dev: | ||
region: ${vars.region} | ||
prod: | ||
region: cn-shanghai | ||
|
||
service: insight-poc | ||
|
||
|
This file contains 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