Azure Функция Deploy с Дженкинс - PullRequest
1 голос
/ 12 марта 2020

Я создал приложение функции azure с помощью следующей команды:

az functionapp create --resource-group <resource_name> --consumption-plan-location eastus --name <function_app_name> --storage-account <storage_account> --runtime python --runtime-version 3.7 --functions-version 3 --os-type Linux --deployment-local-git

Я пытаюсь развернуть свои функции с помощью следующего сценария конвейера:

node {
   stage('Preparation') { // for display purposes
      // Get some code from a GitHub repository
      git branch: 'master',
      credentialsId:'4222f74d-44c5-4167-99b5-3a61b2d2d1f0',
      url: <github url>

   }
   stage('Publish') {
      azureFunctionAppPublish azureCredentialsId: 'e9ba5433-b5de-4732-ad17-8a517516827d',
                        resourceGroup: < resource_name >, appName: <function_app_name>,
                        filePath: '**/*.py,requirements.txt'

   }
}

Но я получаю эту ошибку:

using GIT_ASKPASS to set credentials 
 > git fetch --tags --progress -- https://<function_name>.scm.azurewebsites.net:443/<function_name>.git +refs/heads/*:refs/remotes/origin/* # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
hudson.plugins.git.GitException: Command "git fetch --tags --progress -- https://<function_name>.scm.azurewebsites.net:443/<function_name>.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: repository 'https://<function_name>.scm.azurewebsites.net:443/<function_name>.git/' not found

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2044)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:81)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:569)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:798)
    at com.microsoft.jenkins.function.commands.GitDeployCommand.execute(GitDeployCommand.java:84)
    at com.microsoft.jenkins.function.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.function.FunctionAppDeploymentRecorder.perform(FunctionAppDeploymentRecorder.java:97)
    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.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Finished: FAILURE

Кажется, что подключение не может аутентифицироваться в моем git локальном репо на Azure.

Любой совет?

1 Ответ

0 голосов
/ 05 апреля 2020

Я смог воспроизвести вашу проблему и увидел, что в настоящее время azureFunctionAppPubli sh плагин не принимает / не проверяет Azure Функции типа Linux ОС. Если интересно, я бы предложил вам (способ, который работал для меня, т. Е.) Попробовать то же самое с Azure функцией, которая имеет Windows тип ОС, и она будет работать. Или в качестве обходного пути вы можете установить Azure CLI / Azure PowerShell Jenkins plug-s (s) и попробовать командный способ развертывания соответствующим образом.

С другой стороны, я понимаю, что вы можете захотеть использовать * Плагин 1005 * azureFunctionAppPubli sh и требуется развернуть только под Linux тип ОС / python, тогда в этом случае я предлагаю вызвать ошибку в Jenkins JIRA , как упоминалось здесь вот как сопровождающие azureFunctionAppPubli sh записывают или работают над ошибками и запросами функций.

Надеюсь, это поможет!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...