Azure构建代理

huangapple go评论82阅读模式
英文:

Azure build Agent

问题

情境: 在 Azure Pipeline 的构建过程中,我在自托管代理上使用 JavaToolInstaller,在目录中放置了“java/JAVA_HOME_8_x64_”。

背景: 我认为这不是权限问题,因为我已经为该目录应用了完全权限,并为构建过程创建了它。

评估: 有人之前遇到过这个问题吗?

重现步骤 - 托管本地代理

JavaToolInstaller

- task: JavaToolInstaller@0
  inputs:
    versionSpec: '8'
    jdkArchitectureOption: 'x64'
    jdkSourceOption: 'LocalDirectory'
    jdkFile: '/opt/jdk-8u251-linux-x64.tar.gz'
    jdkDestinationDirectory: '/opt/java'
    cleanDestinationDirectory: true
  condition: eq(variables['Agent.OS'], 'Linux')

构建期间的错误

在解压缩之前清理目标文件夹:/opt/java
从本地路径检索 JDK。
##[warning]找不到键的 loc 字符串:ExtractingArchiveToPath
正在解压缩至路径 /opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
正在创建目标文件夹:/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
##[error]无法创建目录 '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'。EACCES:权限被拒绝,mkdir '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'
##[error]无法创建目录 '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'。EACCES:权限被拒绝,mkdir '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'
完成:JavaToolInstaller
英文:

Situation: During the build process of an azure pipeline i use the JavaToolInstaller on a self hosted agent and it places "java/JAVA_HOME_8_x64_" in the directory <br />
Background: I dont believe this to be a permission issue when i have applied full permissions to that directory and created it for the build process <br />
Assessment: Has anyone see this issue before?

Steps to reproduce - host onsite agent

JavaToolInstaller

- task: JavaToolInstaller@0
  inputs:
    versionSpec: &#39;8&#39;
    jdkArchitectureOption: &#39;x64&#39;
    jdkSourceOption: &#39;LocalDirectory&#39;
    jdkFile: &#39;/opt/jdk-8u251-linux-x64.tar.gz&#39;
    jdkDestinationDirectory: &#39;/opt/java&#39;
    cleanDestinationDirectory: true
  condition: eq( variables[&#39;Agent.OS&#39;], &#39;Linux&#39; )

Error during build

Cleaning destination folder before extraction: /opt/java
Retrieving the JDK from local path.
##[warning]Can\&#39;t find loc string for key: ExtractingArchiveToPath
ExtractingArchiveToPath /opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
Creating destination folder: /opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
##[error]Unable to create directory &#39;/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz&#39;. EACCES: permission denied, mkdir &#39;/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz&#39;
##[error]Unable to create directory &#39;/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz&#39;. EACCES: permission denied, mkdir &#39;/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz&#39;
Finishing: JavaToolInstaller

答案1

得分: 0

根据错误消息,似乎您没有写入此文件的权限。请检查并确保您对此文件夹具有写入和读取权限。

步骤:

定位文件jdk-8u251-linux-x64.tar.gz->右键单击图标->选择属性->点击权限选项卡,然后检查帐户权限

或者使用命令 ls –l {file name} 来检查文件夹权限,然后运行命令 chmod [permission] [file_name] 来更新权限

请参考此链接获取更多详细信息:如何在Linux中更改目录权限

英文:

According to the error message, it seems that you do not have permission to write this file. Please check it and ensure that you have w and r permission for this folder

Steps:

Locate the file jdk-8u251-linux-x64.tar.gz->right-click on the icon->select Properties->click the tab permission then check the account permission

Or use the cmd ls –l {file name} to check the folder permission, then run the cmd chmod [permission] [file_name] to update the permission

Please refer this link for more details: How to change directory permissions in Linux

huangapple
  • 本文由 发表于 2020年8月16日 18:35:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/63435823.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定