Skip to content

Commit

Permalink
Hari/beautify logs (#206)
Browse files Browse the repository at this point in the history
* Logging changes for deploy

* Logging Changes with group

* format check changes
  • Loading branch information
hsubramanianaks authored Jun 29, 2022
1 parent ecec591 commit 7b11ddb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/actions/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function deploy(
core.debug('Input manifest files: ' + inputManifestFiles)

// deploy manifests
core.info('Deploying manifests')
core.startGroup('Deploying manifests')
const trafficSplitMethod = parseTrafficSplitMethod(
core.getInput('traffic-split-method', {required: true})
)
Expand All @@ -36,28 +36,31 @@ export async function deploy(
kubectl,
trafficSplitMethod
)
core.endGroup()
core.debug('Deployed manifest files: ' + deployedManifestFiles)

// check manifest stability
core.info('Checking manifest stability')
core.startGroup('Checking manifest stability')
const resourceTypes: Resource[] = getResources(
deployedManifestFiles,
models.DEPLOYMENT_TYPES.concat([
KubernetesConstants.DiscoveryAndLoadBalancerResource.SERVICE
])
)
await checkManifestStability(kubectl, resourceTypes)
core.endGroup()

if (deploymentStrategy == DeploymentStrategy.BLUE_GREEN) {
core.info('Routing blue green')
core.startGroup('Routing blue green')
const routeStrategy = parseRouteStrategy(
core.getInput('route-method', {required: true})
)
await routeBlueGreen(kubectl, inputManifestFiles, routeStrategy)
core.endGroup()
}

// print ingresses
core.info('Printing ingresses')
core.startGroup('Printing ingresses')
const ingressResources: Resource[] = getResources(deployedManifestFiles, [
KubernetesConstants.DiscoveryAndLoadBalancerResource.INGRESS
])
Expand All @@ -67,9 +70,10 @@ export async function deploy(
ingressResource.name
)
}
core.endGroup()

// annotate resources
core.info('Annotating resources')
core.startGroup('Annotating resources')
let allPods
try {
allPods = JSON.parse((await kubectl.getAllPods()).stdout)
Expand All @@ -82,4 +86,5 @@ export async function deploy(
resourceTypes,
allPods
)
core.endGroup()
}

0 comments on commit 7b11ddb

Please sign in to comment.