in src/tasks/BeanstalkDeployApplication/TaskOperations.ts [27:102]
public async execute(): Promise<void> {
await BeanstalkUtils.verifyApplicationExists(this.beanstalkClient, this.taskParameters.applicationName)
await BeanstalkUtils.verifyEnvironmentExists(
this.beanstalkClient,
this.taskParameters.applicationName,
this.taskParameters.environmentName
)
const versionLabel = BeanstalkUtils.constructVersionLabel(this.taskParameters.versionLabel)
let s3Bucket: string
let s3Key: string
if (
this.taskParameters.applicationType === applicationTypeAspNet ||
this.taskParameters.applicationType === applicationTypeAspNetCoreForWindows ||
this.taskParameters.applicationType === applicationTypeAspNetCoreForLinux
) {
s3Bucket = await BeanstalkUtils.determineS3Bucket(this.beanstalkClient)
let deploymentBundle: string
if (this.taskParameters.applicationType === applicationTypeAspNetCoreForWindows) {
const tempDirectory = SdkUtils.getTempLocation()
deploymentBundle = await BeanstalkUtils.prepareAspNetCoreBundleWindows(
this.taskParameters.dotnetPublishPath,
tempDirectory
)
} else if (this.taskParameters.applicationType === applicationTypeAspNetCoreForLinux) {
const tempDirectory = SdkUtils.getTempLocation()
deploymentBundle = await BeanstalkUtils.prepareAspNetCoreBundleLinux(
this.taskParameters.dotnetPublishPath,
tempDirectory
)
} else {
deploymentBundle = this.taskParameters.webDeploymentArchive
}
s3Key = `${this.taskParameters.applicationName}/${this.taskParameters.environmentName}/${basename(
deploymentBundle,
'.zip'
)}-${versionLabel}.zip`
await BeanstalkUtils.uploadBundle(this.s3Client, deploymentBundle, s3Bucket, s3Key)
} else {
s3Bucket = this.taskParameters.deploymentBundleBucket
s3Key = this.taskParameters.deploymentBundleKey
}
const startingEventDate = await this.getLatestEventDate(
this.taskParameters.applicationName,
this.taskParameters.environmentName
)
await this.updateEnvironment(
s3Bucket,
s3Key,
this.taskParameters.applicationName,
this.taskParameters.environmentName,
versionLabel,
this.taskParameters.description,
this.taskParameters.applicationType === applicationTypeExistingVersion
)
await this.waitForDeploymentCompletion(
this.taskParameters.applicationName,
this.taskParameters.environmentName,
startingEventDate,
this.taskParameters.eventPollingDelay
)
if (this.taskParameters.outputVariable) {
console.log(tl.loc('SettingOutputVariable', this.taskParameters.outputVariable, versionLabel))
tl.setVariable(this.taskParameters.outputVariable, versionLabel)
}
console.log(tl.loc('TaskCompleted', this.taskParameters.applicationName))
}