Ошибка конвейера при развертывании приложения beanstalk - PullRequest
0 голосов
/ 05 октября 2019

Я в процессе настройки конвейера CI с помощью Azure DevOps. Я сталкиваюсь с ошибкой при попытке запустить конвейер вручную. Я получаю следующую ошибку:

err

Я пропустил некоторые шаги в моем файле pipe.yml? Нужно ли публиковать перед развертыванием в Elastic Beanstalk? Вот мой файл azure-pipelines.yml:

# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build- 
aspnet-4

trigger:
- master

pool:
vmImage: 'windows-latest'

variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'

- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package 
/p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true 
/p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'


- task: BeanstalkDeployApplication@1
inputs:
    awsCredentials: 'mypipelinetest'
    regionName: 'eu-west-1'
    applicationName: 'BookingSys'
    environmentName: 'BookingSys-env'
    applicationType: 'aspnet'

Журнал ошибок BeanstlakDeployApplicaion (надеюсь, этого достаточно для решения моей проблемы):

##[section]Starting: BeanstalkDeployApplication

==============================================================================
Task         : AWS Elastic Beanstalk Deploy Application
Description  : Deploys an application to Amazon EC2 instance(s) using AWS Elastic Beanstalk
Version      : 1.5.0
Author       : Amazon Web Services
Help         : Please refer to [AWS Elastic Beanstalk User Guide](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html) for more details on deploying applications with AWS Elastic Beanstalk.

More information on this task can be found in the [task reference](https://docs.aws.amazon.com/vsts/latest/userguide/elastic-beanstalk-deploy.html).

####Task Permissions
This task requires permissions to call the following AWS service APIs (not all APIs may be used depending on selected task options and environment configuration):
* autoscaling:DescribeScalingActivities
* autoscaling:DescribeAutoScalingGroups
* autoscaling:ResumeProcesses
* autoscaling:SuspendProcesses
* cloudformation:DescribeStackResource
* cloudformation:DescribeStackResources
* elasticbeanstalk:CreateApplicationVersion
* elasticbeanstalk:CreateStorageLocation
* elasticbeanstalk:DescribeApplications
* elasticbeanstalk:DescribeEnvironments
* elasticbeanstalk:DescribeEvents
* elasticloadbalancing:RegisterInstancesWithLoadBalancer
* elasticbeanstalk:UpdateEnvironment

The task also requires permissions to upload your application content to the specified Amazon S3 bucket. Depending on the size of the application bundle, either PutObject or the S3 multi-part upload APIs may be used.
==============================================================================
Deployment type set to aspnet
Configuring credentials for task
46da083f-a34f-46a7-a532-e33470f5c4bf exists true
...configuring AWS credentials from service endpoint '46da083f-a34f-46a7-a532-e33470f5c4bf'
...endpoint defines standard access/secret key credentials
Configuring region for task
...configured to use region eu-west-1, defined in task.
Configuring credentials for task
46da083f-a34f-46a7-a532-e33470f5c4bf exists true
...configuring AWS credentials from service endpoint '46da083f-a34f-46a7-a532-e33470f5c4bf'
...endpoint defines standard access/secret key credentials
Configuring region for task
...configured to use region eu-west-1, defined in task.
Determine S3 bucket elasticbeanstalk-eu-west-1-989127099484 to store application bundle
Uploading application bundle d:\a\1\s to object BookingSys/BookingSys-env/s-v1570289695608.zip in bucket elasticbeanstalk-eu-west-1-989127099484
Upload of application bundle failed with error: EISDIR: illegal operation on a directory, read { Error: EISDIR: illegal operation on a directory, read
    at Error (native) errno: -4068, code: 'EISDIR', syscall: 'read' }
##[error]Error: EISDIR: illegal operation on a directory, read
##[section]Finishing: BeanstalkDeployApplication

Может быть, я смогунеправильное расположение файлов в моем репозитории GitHub? Вот мой репозиторий Git: https://github.com/craig1990/CampBookingSys-4th-Year-Project

Извините меня, если мне не хватает чего-то простого, хотя я впервые использую DevOps Azure. Кто-нибудь может понять, почему я получаю вышеуказанную ошибку?

1 Ответ

1 голос
/ 05 октября 2019

Как отмечается в выходных данных задачи, вы должны загрузить zip-файл в корзину S3, прежде чем сможете его развернуть.

Пример приведен здесь . Очевидно, что вам необходимо изменить приведенное ниже, чтобы отразить имена файлов, которые вы используете, и ваши ресурсы AWS.

- task: S3Upload@1
  displayName: 'S3 Upload: angular-docker-bucket'
  inputs:
    awsCredentials: 'AWS-test'
    regionName: 'us-east-2'
    bucketName: 'angular-docker-bucket'
    sourceFolder: 'elastic-beanstalk'
    globExpressions: output.zip
    createBucket: true

- task: BeanstalkDeployApplication@1
  displayName: 'Deploy to Elastic Beanstalk: angular-docker-test'
  inputs:
    awsCredentials: 'AWS-test'
    regionName: 'us-east-2'
    applicationName: 'angular-docker-test'
    environmentName: 'AngularDockerTest-env'
    applicationType: s3
    deploymentBundleBucket: 'angular-docker-bucket'
    deploymentBundleKey: output.zip
    logRequest: true
    logResponse: true
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...