在运行管道时,我会收到以下错误
==============================================================================
/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位于正确的路径中,但我不知道为什么管道没有说路径未找到。

这是我的码头文件
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下面是提升部署文件的管道步骤,但在此步骤中出现错误
- 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'发布于 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。
https://stackoverflow.com/questions/73140116
复制相似问题