Merge pull request #42 from horihiro/feature/pulling-from-private-repository

This commit is contained in:
Kodai Sakabe 2022-09-20 13:34:50 +09:00 коммит произвёл GitHub
Родитель 1c028fa7e0 b92c620baa
Коммит 27880ef862
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 15 добавлений и 12 удалений

Просмотреть файл

@ -1,6 +1,6 @@
import * as core from "@actions/core";
import * as crypto from "crypto";
import { ContainerAppsAPIClient, ContainerApp, TrafficWeight } from "@azure/arm-appcontainers";
import { ContainerAppsAPIClient, ContainerApp, TrafficWeight, Revision } from "@azure/arm-appcontainers";
import { TokenCredential, DefaultAzureCredential } from "@azure/identity";
import { AuthorizerFactory } from "azure-actions-webclient/AuthorizerFactory";
import { IAuthorizer } from "azure-actions-webclient/Authorizer/IAuthorizer";
@ -119,24 +119,27 @@ async function main() {
console.log("Deployment Step Started");
let containerAppDeploymentResult = await client.containerApps.beginCreateOrUpdateAndWait(
// update
await client.containerApps.beginUpdateAndWait(
taskParams.resourceGroup,
taskParams.containerAppName,
containerAppEnvelope,
);
if (containerAppDeploymentResult.provisioningState == "Succeeded") {
console.log("Deployment Succeeded");
// check if added revision is included in revision list
const addedRevision = await client.containerAppsRevisions.getRevision(
taskParams.resourceGroup,
taskParams.containerAppName,
`${taskParams.containerAppName}--${taskParams.revisionNameSuffix}`
)
if (!addedRevision) throw new Error(`Failed to add revision ${taskParams.containerAppName}--${taskParams.revisionNameSuffix}.`);
if (ingresConfig.external == true) {
let appUrl = "http://" + containerAppDeploymentResult.latestRevisionFqdn + "/"
core.setOutput("app-url", appUrl);
console.log("Your App has been deployed at: " + appUrl);
}
} else {
core.debug("Deployment Result: " + containerAppDeploymentResult);
throw Error("Container Deployment Failed" + containerAppDeploymentResult);
if (ingresConfig.external == true && addedRevision.fqdn) {
let appUrl = "https://" + addedRevision.fqdn + "/"
core.setOutput("app-url", appUrl);
console.log("Your App has been deployed at: " + appUrl);
}
console.log("Deployment Succeeded");
}
catch (error: string | any) {
console.log("Deployment Failed with Error: " + error);