Skip to content

Commit

Permalink
Fix pipeline failures
Browse files Browse the repository at this point in the history
  • Loading branch information
snehapar9 committed Nov 6, 2023
1 parent fe94eb9 commit 7d001e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 89 deletions.
81 changes: 0 additions & 81 deletions .github/workflows/run-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ jobs:
TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}'

steps:

- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions
- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes

- name: Checkout action repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -83,14 +74,6 @@ jobs:
TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}'

steps:
- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions

- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes
- name: Checkout action repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -134,14 +117,6 @@ jobs:
TEST_CONTAINER_APP_NAME: 'gh-ca-fd-${{ github.run_id }}'

steps:
- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions

- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes
- name: Checkout action repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -383,14 +358,6 @@ jobs:
TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-builder-simple.yaml'

steps:
- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions

- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes
- name: Checkout action repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -450,14 +417,6 @@ jobs:
TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-image-simple.yaml'

steps:
- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions

- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes
- name: Checkout action repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -502,14 +461,6 @@ jobs:
TEST_YAML_FILE_PATH: 'yaml-samples/create-with-image-simple.yaml'

steps:
- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions

- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes
- name: Checkout action repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -554,14 +505,6 @@ jobs:
TEST_CONTAINER_APP_NAME: 'update-using-builder-app'

steps:
- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions

- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes
- name: Checkout action repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -609,14 +552,6 @@ jobs:
TEST_CONTAINER_APP_NAME: 'update-using-builder-app'

steps:
- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions

- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes
- name: Checkout action repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -660,14 +595,6 @@ jobs:
TEST_CONTAINER_APP_NAME: 'update-using-image-app'

steps:
- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions

- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes
- name: Checkout action repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -695,14 +622,6 @@ jobs:
TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/update-with-image-simple.yaml'

steps:
- name: Clone azure-cli-extensions repo
uses: actions/checkout@v3
with:
repository: snehapar9/azure-cli-extensions
path: azure-cli-extensions

- name: Install latest azure-cli-extensions wheel
run: az extension add --source '${{ github.workspace }}/azure-cli-extensions/containerapp-0.3.42-py2.py3-none-any.whl' --yes
- name: Checkout action repository
uses: actions/checkout@v3

Expand Down
8 changes: 4 additions & 4 deletions azurecontainerapps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export class azurecontainerapps {
}

const useAzureContainerRegistry = !this.util.isNullOrEmpty(this.registryUrl) && this.registryUrl.endsWith('.azurecr.io');
const useInternalRegistry = this.util.isNullOrEmpty(this.registryUrl) || this.imageToBuild.startsWith('default/');
const useInternalRegistry = this.util.isNullOrEmpty(this.registryUrl) && this.imageToBuild.startsWith('default/');

// Determine if the image should be built and pushed using the CLI
this.useCliToBuildAndPushImage = !this.util.isNullOrEmpty(this.appSourcePath) && (useAzureContainerRegistry || useInternalRegistry);
this.useCliToBuildAndPushImage = (useAzureContainerRegistry || useInternalRegistry);

// If the application source was provided, build a runnable application image from it
if (!this.useCliToBuildAndPushImage) {
if (!this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath)) {
await this.buildAndPushImageAsync();
}

Expand Down Expand Up @@ -513,7 +513,7 @@ export class azurecontainerapps {
}
}

if (this.useCliToBuildAndPushImage) {
if (this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath)) {
this.commandLineArgs.push(`--source ${this.appSourcePath}`);
}
}
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ var azurecontainerapps = /** @class */ (function () {
_a.label = 7;
case 7:
useAzureContainerRegistry = !this.util.isNullOrEmpty(this.registryUrl) && this.registryUrl.endsWith('.azurecr.io');
useInternalRegistry = this.util.isNullOrEmpty(this.registryUrl) || this.imageToBuild.startsWith('default/');
useInternalRegistry = this.util.isNullOrEmpty(this.registryUrl) && this.imageToBuild.startsWith('default/');
// Determine if the image should be built and pushed using the CLI
this.useCliToBuildAndPushImage = !this.util.isNullOrEmpty(this.appSourcePath) && (useAzureContainerRegistry || useInternalRegistry);
if (!!this.useCliToBuildAndPushImage) return [3 /*break*/, 9];
this.useCliToBuildAndPushImage = (useAzureContainerRegistry || useInternalRegistry);
if (!(!this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath))) return [3 /*break*/, 9];
return [4 /*yield*/, this.buildAndPushImageAsync()];
case 8:
_a.sent();
Expand Down Expand Up @@ -603,7 +603,7 @@ var azurecontainerapps = /** @class */ (function () {
this.commandLineArgs.push("--env-vars " + environmentVariables);
}
}
if (this.useCliToBuildAndPushImage) {
if (this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath)) {
this.commandLineArgs.push("--source " + this.appSourcePath);
}
};
Expand Down

0 comments on commit 7d001e7

Please sign in to comment.