Search in sources :

Example 1 with DeployHandler

use of com.microsoft.azure.plugin.functions.gradle.handler.DeployHandler in project azure-gradle-plugins by microsoft.

the class DeployTask method deploy.

@TaskAction
@AzureOperation(name = "functionapp.deploy_app", type = AzureOperation.Type.ACTION)
public void deploy() throws GradleException {
    try {
        ProxyManager.getInstance().applyProxy();
        TelemetryAgent.getInstance().addDefaultProperty(PROXY, String.valueOf(ProxyManager.getInstance().isProxyEnabled()));
        TelemetryAgent.getInstance().trackTaskStart(this.getClass());
        final GradleFunctionContext ctx = new GradleFunctionContext(getProject(), this.getFunctionsExtension());
        TelemetryAgent.getInstance().addDefaultProperties(ctx.getTelemetryProperties());
        final DeployHandler deployHandler = new DeployHandler(ctx);
        deployHandler.execute();
        TelemetryAgent.getInstance().trackTaskSuccess(this.getClass());
    } catch (final Exception e) {
        AzureMessager.getMessager().error(e);
        TelemetryAgent.getInstance().traceException(this.getClass(), e);
        throw new GradleException(DEPLOY_FAILURE + e.getMessage(), e);
    }
}
Also used : GradleException(org.gradle.api.GradleException) GradleFunctionContext(com.microsoft.azure.plugin.functions.gradle.GradleFunctionContext) GradleException(org.gradle.api.GradleException) DeployHandler(com.microsoft.azure.plugin.functions.gradle.handler.DeployHandler) TaskAction(org.gradle.api.tasks.TaskAction) AzureOperation(com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)

Aggregations

GradleFunctionContext (com.microsoft.azure.plugin.functions.gradle.GradleFunctionContext)1 DeployHandler (com.microsoft.azure.plugin.functions.gradle.handler.DeployHandler)1 AzureOperation (com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)1 GradleException (org.gradle.api.GradleException)1 TaskAction (org.gradle.api.tasks.TaskAction)1