首页 文章

Jenkins管道与Azure Web应用程序部署

提问于
浏览
2

我正在尝试使用Jenkins管道和Azure Webapp Deployment plugin将我们的webapp发布到Azure . 我无法让它发挥作用 . 奇怪的是,我甚至没有得到一个像样的错误信息 . 我的Jenkins文件包含以下内容

stage("Publish to Azure") {
    steps {
        azureWebAppPublish ([
            appName: "xxx", 
            azureCredentialsId: "xxx", 
            publishType: "file", 
            resourceGroup: "xxx", 
            sourceDirectory: "docs/export"
        ])
    }
}

启动Azure Web App部署克隆存储库xxx.git C:\ Program Files \ Git \ bin \ git.exe init D:\ Jenkins \ workspace \ xxx #timeout = 10从xxx获取上游更改C:\ Program Files \ Git \ bin \ git.exe --version#timeout = 10使用GIT_ASKPASS设置凭据C:\ Program Files \ Git \ bin \ git.exe fetch --tags --progress xxx.git refs / heads /:refs / remotes / origin / C:\ Program Files \ Git \ bin \ git.exe config remote.origin.url xxx.git #timetime = 10 C:\ Program Files \ Git \ bin \ git.exe config --add remote.origin.fetch refs / heads /:refs / remotes / origin / #timetime = 10在存储库origin / master中看到分支看到1个远程分支C:\ Program Files \ Git \ bin \ git.exe config core.sparsecheckout #timetime = 10 C:\ Program Files \ Git \ bin \ git.exe checkout -f master

然后管道失败,没有明显的错误......任何想法?

编辑:当我打开作业本身时,它显示以下内容:

java.lang.NullPointerException
    at hudson.FilePath.isAbsolute(FilePath.java:304)
    at hudson.FilePath.glob(FilePath.java:1807)
    at hudson.FilePath.access$1900(FilePath.java:208)
    at hudson.FilePath$31.invoke(FilePath.java:1788)
    at hudson.FilePath$31.invoke(FilePath.java:1785)
    at hudson.FilePath.act(FilePath.java:1020)
    at hudson.FilePath.act(FilePath.java:998)
    at hudson.FilePath.list(FilePath.java:1785)
    at hudson.FilePath.list(FilePath.java:1769)
    at hudson.FilePath.list(FilePath.java:1754)
    at com.microsoft.jenkins.appservice.commands.GitDeployCommand.copyAndAddFiles(GitDeployCommand.java:267)
    at com.microsoft.jenkins.appservice.commands.GitDeployCommand.execute(GitDeployCommand.java:100)
    at com.microsoft.jenkins.appservice.commands.GitDeployCommand.execute(GitDeployCommand.java:53)
    at com.microsoft.jenkins.azurecommons.command.CommandService.runCommand(CommandService.java:88)
    at com.microsoft.jenkins.azurecommons.command.CommandService.execute(CommandService.java:96)
    at com.microsoft.jenkins.azurecommons.command.CommandService.executeCommands(CommandService.java:75)
    at com.microsoft.jenkins.azurecommons.command.BaseCommandContext.executeCommands(BaseCommandContext.java:77)
    at com.microsoft.jenkins.appservice.WebAppDeploymentRecorder.perform(WebAppDeploymentRecorder.java:203)
    at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
    at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
    at hudson.security.ACL.impersonate(ACL.java:290)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

提前致谢!问候

1 回答

  • 1

    我发现了这个问题 . filePath是必填字段 . 固定使用:

    stage("Publish to Azure") {
                steps {
                    azureWebAppPublish appName: "xxx",
                        azureCredentialsId: "xxx",
                        publishType: "file",
                        filePath: "**/*.*",
                        resourceGroup: "xxx",
                        sourceDirectory: "xxx"
                }
            }
    

    该异常已得到修复,您可以看到here

相关问题