diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 8bc398e6..805fa742 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index abad227a..fc5ecd29 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -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(); } @@ -513,7 +513,7 @@ export class azurecontainerapps { } } - if (this.useCliToBuildAndPushImage) { + if (this.useCliToBuildAndPushImage && !this.util.isNullOrEmpty(this.appSourcePath)) { this.commandLineArgs.push(`--source ${this.appSourcePath}`); } } diff --git a/dist/index.js b/dist/index.js index 7c77dafb..98c7b3c4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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(); @@ -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); } };