首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >路径"/home/vsts/work/1/s/javapipetest13/Orchestration/dev/deployment.yaml“不存在

路径"/home/vsts/work/1/s/javapipetest13/Orchestration/dev/deployment.yaml“不存在
EN

Stack Overflow用户
提问于 2022-07-27 14:49:37
回答 1查看 391关注 0票数 0

在运行管道时,我会收到以下错误

代码语言:javascript
复制
==============================================================================
/usr/local/bin/kubectl apply -n default -f /home/vsts/work/1/s/javapipetest13/Orchestration/dev/deployment.yaml -o json
error: the path "/home/vsts/work/1/s/javapipetest13/Orchestration/dev/deployment.yaml" does not exist
##[error]error: the path "/home/vsts/work/1/s/javapipetest13/Orchestration/dev/deployment.yaml" does not exist
commandOutput
##[error]The process '/usr/local/bin/kubectl' failed with exit code 1
Finishing: Kubernetes

我的文件deployment.yml位于正确的路径中,但我不知道为什么管道没有说路径未找到。

这是我的码头文件

代码语言:javascript
复制
FROM java:8-alpine
ENV APP_FILE='*-0.0.1-SNAPSHOT.jar'
#COPY ./lib/elastic-apm-agent-1.28.1.jar /lib
ENV APP_HOME=/usr/app
RUN mkdir /usr/app && touch /tmp/spring.log && chmod 777 /tmp/spring.log
EXPOSE 8080 8090 8091
COPY target/$APP_FILE $APP_HOME/
CMD java -jar $APP_HOME/$APP_FILE

下面是提升部署文件的管道步骤,但在此步骤中出现错误

代码语言:javascript
复制
- task: Kubernetes@1
    inputs:
      connectionType: 'Azure Resource Manager'
      azureSubscriptionEndpoint: 'sc-icndp'
      azureResourceGroup: 'eus-icndp-rg'
      kubernetesCluster: 'icndp-aks'
      namespace: 'default'
      command: 'apply'
      arguments: '-f $(Build.SourcesDirectory)/$(Build.Repository.Name)/Orchestration/dev/deployment.yaml'
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-28 08:04:08

从YAML示例和Repo的屏幕截图中,您需要确认是否在管道中签出单个回购。

如果是,文件路径将不包含回购名称。

您可以更改路径:$(Build.SourcesDirectory)/Orchestration/dev/deployment.yaml

请参阅以下文档:结帐路径

单个存储库:如果您的工作中有一个签出步骤,或者没有与签出: self等价的签出步骤,则将您的源代码签出到一个名为s的目录中,该目录位于(Agent.BuildDirectory)的子文件夹中。如果(Agent.BuildDirectory)是C:\agent_work\1,则将代码签出到C:\agent_work\1\s。多个存储库:如果工作中有多个签出步骤,则源代码将签出到以存储库命名的目录中,作为s in (Agent.BuildDirectory)的子文件夹。如果(Agent.BuildDirectory)是C:\agent_work\1,并且您的存储库被命名为工具和代码,那么您的代码将被签出到C:\agent_work\1\s\tools和C:\agent_work\1\s\code。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73140116

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档