Skip to content

Commit 5f5f4c5

Browse files
authored
[Do Not Merge] Snehapar/app spaces env deletion test (#107)
* Remove cli install * Comment cli install * Test-if envs are propgated * Uncomment cli installation * Update index file * don't use up for cloud build * comment out cli installation * Remove comments * Address comments * Update index.js
1 parent 02d0451 commit 5f5f4c5

File tree

2 files changed

+129
-154
lines changed

2 files changed

+129
-154
lines changed

azurecontainerapps.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ export class azurecontainerapps {
3636
// Set up property to determine if the internal registry should be used
3737
this.useInternalRegistry = this.util.isNullOrEmpty(this.registryUrl);
3838

39-
// Set up property to trigger cloud build with 'up' command
40-
this.shouldCreateOrUpdateContainerAppWithUp = !this.util.isNullOrEmpty(this.appSourcePath) && this.useInternalRegistry;
41-
4239
// If the application source was provided, build a runnable application image from it
4340
if (!this.useInternalRegistry && !this.util.isNullOrEmpty(this.appSourcePath)) {
4441
await this.buildAndPushImageAsync();
@@ -109,7 +106,6 @@ export class azurecontainerapps {
109106
private static buildArguments: string;
110107
private static noIngressUpdate: boolean;
111108
private static useInternalRegistry: boolean;
112-
private static shouldCreateOrUpdateContainerAppWithUp: boolean;
113109

114110
/**
115111
* Initializes the helpers used by this task.
@@ -621,11 +617,9 @@ export class azurecontainerapps {
621617
// Ensure '-i' argument and '--source' argument are not both provided
622618
if (!this.util.isNullOrEmpty(this.imageToDeploy)) {
623619
this.commandLineArgs.push(`-i ${this.imageToDeploy}`);
624-
} else if (this.shouldCreateOrUpdateContainerAppWithUp) {
620+
} else if (!this.util.isNullOrEmpty(this.appSourcePath) && this.useInternalRegistry) {
625621
this.commandLineArgs.push(`--source ${this.appSourcePath}`);
626-
this.commandLineArgs.push(`-l ${this.location}`);
627622
}
628-
629623
}
630624

631625
/**
@@ -636,8 +630,6 @@ export class azurecontainerapps {
636630
if (!this.util.isNullOrEmpty(this.yamlConfigPath)) {
637631
// Create the Container App from the YAML configuration file
638632
await this.appHelper.createContainerAppFromYaml(this.containerAppName, this.resourceGroup, this.yamlConfigPath);
639-
} else if (this.shouldCreateOrUpdateContainerAppWithUp) {
640-
await this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.commandLineArgs);
641633
} else {
642634
// Create the Container App from command line arguments
643635
await this.appHelper.createContainerApp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.commandLineArgs);
@@ -653,16 +645,14 @@ export class azurecontainerapps {
653645
return;
654646
}
655647

656-
if (this.noIngressUpdate && !this.shouldCreateOrUpdateContainerAppWithUp) {
648+
if (this.noIngressUpdate) {
657649
// Update the Container Registry details on the existing Container App, if provided as an input
658650
if (!this.util.isNullOrEmpty(this.registryUrl) && !this.util.isNullOrEmpty(this.registryUsername) && !this.util.isNullOrEmpty(this.registryPassword)) {
659651
await this.appHelper.updateContainerAppRegistryDetails(this.containerAppName, this.resourceGroup, this.registryUrl, this.registryUsername, this.registryPassword);
660652
}
661653

662654
// Update the Container App using the 'update' command
663655
await this.appHelper.updateContainerApp(this.containerAppName, this.resourceGroup, this.commandLineArgs);
664-
} else if (this.shouldCreateOrUpdateContainerAppWithUp) {
665-
await this.appHelper.createOrUpdateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.commandLineArgs);
666656
} else if (this.adminCredentialsProvided && !this.noIngressUpdate) {
667657
// Update the Container App with `up` command when admin credentials are provided and ingress is manually provided.
668658
await this.appHelper.updateContainerAppWithUp(this.containerAppName, this.resourceGroup, this.commandLineArgs, this.ingress, this.targetPort);

0 commit comments

Comments
 (0)