Skip to content

Build pipeline failed with azure #5

@yaoyaoTheCat

Description

@yaoyaoTheCat

Hi,
Thanks for sharing. I have tried to setup the build pipeline in azure with azure container registery and get below error:

Step 6/19 : RUN poetry install
 ---> Running in f06e7d5e44e6

  RuntimeError

  Poetry could not find a pyproject.toml file in /backend or its parents

  at /usr/local/lib/python3.10/site-packages/poetry/core/factory.py:369 in locate
      365│             if poetry_file.exists():
      366│                 return poetry_file
      367│ 
      368│         else:
    → 369│             raise RuntimeError(
      370│                 "Poetry could not find a pyproject.toml file in {} or its parents".format(
      371│                     cwd
      372│                 )
      373│             )
The command '/bin/sh -c poetry install' returned a non-zero code: 1
##[error]The command '/bin/sh -c poetry install' returned a non-zero code: 1
##[error]The process '/usr/bin/docker' failed with exit code 1
Finishing: Build and push an image to container registry

My azure-pipelines.yml file looks like this ( I haven't figure out how to add the unit tests and deploy to the tasks yet):

trigger:
- main


resources:
- repo: self

variables:
  # Container registry service connection established during pipeline creation
  dockerRegistryServiceConnection: 'xxxxxx'
  imageRepository: 'someimg'
  containerRegistry: 'somereporeg.azurecr.io'
  dockerfilePath: '$(Build.SourcesDirectory)/deploy/docker/Dockerfile'
  tag: '$(Build.BuildId)'

  # Agent VM image name
  vmImageName: 'ubuntu-latest'

stages:
- stage: Build
  displayName: Build and push stage
  jobs:
  - job: Build
    displayName: Build
    pool:
      vmImage: $(vmImageName)
    steps:
    - task: Docker@2
      displayName: Build and push an image to container registry
      inputs:
        command: buildAndPush
        repository: $(imageRepository)
        dockerfile: $(dockerfilePath)
        containerRegistry: $(dockerRegistryServiceConnection)
        tags: |
          $(tag)

any reason why?
Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions