[英]Azure DevOps Magento 2 Pipeline
I am facing an error while I'm making CI of Magento using Azure DevOps.我在使用 Azure DevOps 制作 Magento 的 CI 时遇到错误。
In AuthHelper.php line 197:
The 'https://repo.magento.com/archives/magento/framework/magento-framework-
103.0.3.0.zip' URL required authentication (HTTP 401).
You must be using the interactive console to authenticate
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
##[debug]Exit code 255 received from tool '/usr/bin/bash'
##[debug]STDIO streams have closed for tool '/usr/bin/bash'
##[error]Bash exited with code '255'.
##[debug]Processed:
##vso[task.issue type=error;]Bash exited with code '255'.
##[debug]task result: Failed
##[debug]Processed:
##vso[task.complete result=Failed;done=true;]
Here is my yaml:这是我的 yaml:
trigger:
- master
pool:
vmImage: ubuntu-latest
variables:
phpVersion: 7.4.3
steps:
- script: |
composer self-update
composer dump-autoload
composer install --ignore-platform-reqs
displayName: 'Install Composer'
- task: ArchiveFiles@2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: false
archiveType: zip
archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
I have also used multiple commands for installing the composer我还使用了多个命令来安装作曲家
- script: composer install --no-interaction --prefer-dist
This is one of them please have a look at these这是其中之一,请看看这些
- script: |
composer self-update
composer dump-autoload
php -r 'file_put_contents("composer.json", json_encode(array_merge_recursive(json_decode(file_get_contents("composer.json"), true), json_decode("{\"extra\": {\"magento-force\": \"override\"}, \"autoload\": {\"psr-4\": {\"Magento\\\\Framework\\\\\": \"lib/internal/Magento/Framework/\", \"Magento\\\\Setup\\\\\": \"setup/src/Magento/Setup/\", \"Magento\\\\\": \"app/code/Magento/\"}, \"psr-0\": {\"\": [\"app/code/\"]},\"files\": [\"app/etc/NonComposerComponentRegistration.php\"]}}", true), json_decode("$(composerOverride)", true)), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));'
echo '{"_comment": "These credentials were set up using some dummy Magento account", "http-basic": {"repo.magento.com": {"username": "017dbe6c70294588566ae2f1ab07398bb", "password": "ee15f7e08a2d91787554dfc5e668da16c"}}}' > auth.json
composer install --ignore-platform-reqs
find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} + && find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} + && chmod u+x bin/magento
This script can be used to authenticate the user for Magento during azure devops pipeline此脚本可用于在 azure devops 管道期间对 Magento 的用户进行身份验证
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.