in src/strategyHelpers/blueGreen/deploy.ts [53:97]
export async function deployBlueGreenSMI(
kubectl: Kubectl,
filePaths: string[]
): Promise<BlueGreenDeployment> {
// get all kubernetes objects defined in manifest files
const manifestObjects: BlueGreenManifests = getManifestObjects(filePaths)
// create services and other objects
const newObjectsList = [].concat(
manifestObjects.otherObjects,
manifestObjects.serviceEntityList,
manifestObjects.ingressEntityList,
manifestObjects.unroutedServiceEntityList
)
const otherObjDeployment: DeployResult = await deployObjects(
kubectl,
newObjectsList
)
// make extraservices and trafficsplit
const smiAndSvcDeployment = await setupSMI(
kubectl,
manifestObjects.serviceEntityList
)
// create new deloyments
const blueGreenDeployment: BlueGreenDeployment = await deployWithLabel(
kubectl,
manifestObjects.deploymentEntityList,
GREEN_LABEL_VALUE
)
blueGreenDeployment.objects.push(...newObjectsList)
blueGreenDeployment.objects.push(...smiAndSvcDeployment.objects)
blueGreenDeployment.deployResult.manifestFiles.push(
...otherObjDeployment.manifestFiles
)
blueGreenDeployment.deployResult.manifestFiles.push(
...smiAndSvcDeployment.deployResult.manifestFiles
)
return blueGreenDeployment
}