Разверните приложение Python Azure Function от Gitlab - PullRequest
0 голосов
/ 28 марта 2019

Я пытаюсь развернуть свое приложение-функцию Azure, написанное на python, из моего репозитория gitlab, используя CI / CD gitlab. Я следовал лазурному учебнику , и я могу использовать func azure functionapp publish test-app с моего Mac, и он успешно опубликует приложение функции. Теперь я хотел бы, чтобы мой Gitlab CI делал то же самое каждый раз, когда я нажимаю некоторые изменения. Так как я не смог найти изображение докера, готовое к использованию для публикации приложения функции, я создал свой собственный . Мой .gitlab-ci.yml файл выглядит так:

image: mebibou/python-azure-functions

stages:
  - deploy

deploy:
  stage: deploy
  script:
    - az login --service-principal -u $AZURE_SERVICE_PRINCIPAL_USER --password "$AZURE_SERVICE_PRINCIPAL_PASSWORD" --tenant $AZURE_TENANT > /dev/null
    - func settings add FUNCTIONS_WORKER_RUNTIME python
    - func extensions install
    - func azure functionapp publish test-app

Который производит на gitlab:

Running with gitlab-runner 11.4.2 (cf91d5e1)
  on runner-1 6bf966fd
Using Docker executor with image mebibou/python-azure-functions ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:85e924caedbd3e5245ad95cc7471168e923391b22dcb559decebe4a378a06939 for docker:dind ...
Waiting for services to be up and running...
Pulling docker image mebibou/python-azure-functions ...
Using docker image sha256:74d45f6890a1dcf939de9ab58b5298645780da90e00b99c45b719a83d05b539b for mebibou/python-azure-functions ...
Running on runner-6bf966fd-project-29-concurrent-0 via mycompany-gitlab...
Fetching changes...
HEAD is now at e35802a chore(ci): deploy functions
From https://ci.mycompanylab.io/mycompany/geoprocessing
 + e35802a...895c9bc develop    -> origin/develop  (forced update)
Checking out 895c9bc2 as develop...
Skipping Git submodules setup
$ az login --service-principal -u $AZURE_SERVICE_PRINCIPAL_USER --password "$AZURE_SERVICE_PRINCIPAL_PASSWORD" --tenant $AZURE_TENANT > /dev/null
$ func settings add FUNCTIONS_WORKER_RUNTIME python
$ func extensions install

Welcome to .NET Core!
---------------------
Learn more about .NET Core: https://aka.ms/dotnet-docs
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs

Telemetry
---------
The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). For establishing trust on other platforms refer to the platform specific documentation.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for /builds/mycompany/my-repo/extensions.csproj...
  Installing System.Numerics.Vectors 4.4.0.
  Installing System.Buffers 4.4.0.
  Installing Microsoft.Extensions.FileProviders.Abstractions 2.1.0.
  Installing Microsoft.Extensions.FileSystemGlobbing 2.1.0.
  Installing System.Memory 4.5.0.
  Installing Microsoft.Win32.Registry 4.0.0.
  Installing System.Threading.ThreadPool 4.0.10.
  Installing Microsoft.Extensions.Configuration.FileExtensions 2.1.0.
  Installing Microsoft.Extensions.Hosting.Abstractions 2.1.0.
  Installing Microsoft.Extensions.FileProviders.Physical 2.1.0.
  Installing Microsoft.Extensions.DependencyInjection 2.1.0.
  Installing Microsoft.Extensions.Primitives 2.1.0.
  Installing Microsoft.Extensions.Options.ConfigurationExtensions 2.1.0.
  Installing Microsoft.Extensions.Options 2.1.0.
  Installing Microsoft.Extensions.Configuration.Binder 2.1.0.
  Installing Microsoft.Extensions.DependencyInjection.Abstractions 2.1.0.
  Installing System.ComponentModel.Annotations 4.4.0.
  Installing Microsoft.Azure.WebJobs.Extensions.Storage 3.0.0.
  Installing Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator 1.0.1.
  Installing WindowsAzure.Storage 9.3.1.
  Installing Microsoft.Azure.WebJobs 3.0.0.
  Installing System.Runtime.Loader 4.3.0.
  Installing Microsoft.Build.Framework 15.3.409.
  Installing Microsoft.Build.Utilities.Core 15.3.409.
  Installing System.Diagnostics.TraceSource 4.3.0.
  Installing Newtonsoft.Json 10.0.2.
  Installing Microsoft.Extensions.Configuration 2.1.0.
  Installing Microsoft.Extensions.Logging.Abstractions 2.1.0.
  Installing Microsoft.Extensions.Configuration.EnvironmentVariables 2.1.0.
  Installing System.Threading.Tasks.Dataflow 4.8.0.
  Installing System.Diagnostics.Process 4.1.0.
  Installing Microsoft.Azure.WebJobs.Core 3.0.0.
  Installing Microsoft.Extensions.Logging 2.1.0.
  Installing Microsoft.Extensions.Logging.Configuration 2.1.0.
  Installing Microsoft.Extensions.Configuration.Abstractions 2.1.0.
  Installing Microsoft.Extensions.Hosting 2.1.0.
  Installing Microsoft.Extensions.Configuration.Json 2.1.0.
  Installing System.Threading.Thread 4.0.0.
  Installing System.Text.Encoding.CodePages 4.0.1.
  Installing System.Resources.Reader 4.0.0.
  Installing System.Collections.NonGeneric 4.0.1.
  Installing System.Diagnostics.TraceSource 4.0.0.
  Installing System.Runtime.Serialization.Xml 4.1.1.
  Generating MSBuild file /builds/mycompany/my-repo/obj/extensions.csproj.nuget.g.props.
  Generating MSBuild file /builds/mycompany/my-repo/obj/extensions.csproj.nuget.g.targets.
  Restore completed in 2.44 sec for /builds/mycompany/my-repo/extensions.csproj.
  extensions -> /builds/mycompany/my-repo/bin/extensions.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:04.59


$ func azure functionapp publish test-app
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 36.45 ms for /builds/mycompany/my-repo/extensions.csproj.
  extensions -> /builds/mycompany/my-repo/bin/extensions.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.28


Getting site publishing info...
No such file or directory
ERROR: Job failed: exit code 1
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...