Azure Devops Ruby在Rails上的释放错误
我是Azure Devops的新手,想在Rails网站上实现一个简单的Ruby。我在网上看到的教程主要集中在.NET中。以下是我创建的azure-pipeline.yml文件。该代码构建无错误的构建,但是当我在Rauds On Rails模板上创建发行版时,会产生错误。 我的错误, rakefile ,我的构建管道输出看起来像这样。任何人都可以帮助我或参考Ruby on Rails的一些Azure Devops教程。
```
# Ruby
# Package your Ruby project.
# Add steps that install rails, analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/ruby
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: UseRubyVersion@0
inputs:
versionSpec: '>= 3.0'
addToPath: true
- script: |
CALL gem install bundler
bundle init
gem install rake
bundle install --retry=3 --jobs=4
displayName: 'bundle install'
- script: bundle exec rake
displayName: 'bundle exec rake'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'
- task: PublishBuildArtifacts@1
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)'
artifactType: 'pipeline'
artifactName: 'drop'
```
I am new to Azure DEvOps and want to implement a simple ruby on rails website. Tutorials that I see online are mostly focused in .Net. Following is my created azure-pipeline.yml file. The code builds without error but when I create a release with a Ruby on Rails template it gives error. My error,
rakefile
and my build pipeline output looks like this. Can anyone help me on this or refer to some azure devops tutorials for ruby on rails.
```
# Ruby
# Package your Ruby project.
# Add steps that install rails, analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/ruby
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: UseRubyVersion@0
inputs:
versionSpec: '>= 3.0'
addToPath: true
- script: |
CALL gem install bundler
bundle init
gem install rake
bundle install --retry=3 --jobs=4
displayName: 'bundle install'
- script: bundle exec rake
displayName: 'bundle exec rake'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'
- task: PublishBuildArtifacts@1
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)'
artifactType: 'pipeline'
artifactName: 'drop'
```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CI输出告诉您问题在哪里。查找第24和53行。
找不到Rakefile
。在这里知道知道rake rake。它用于执行任务,例如,当您运行
Rails DB:迁移
时,Rake正在完成其工作。因此,您应该在应用程序的根部添加一个rakefile,其中包括:
myapp/ rakefile
编辑:
尝试将YML更改为:
CI output is telling you where is the problem. Look for lines 24 and 53.
No rakefile found
.Here to know abut Rake. It is used for doing tasks, for example when you run
rails db:migrate
, rake is doing its job.So you should add a Rakefile to the root of your application, with:
myapp/Rakefile
EDIT:
try to change your yml to: