【发布时间】:2022-07-28 16:04:08
【问题描述】:
运行管道时出现以下错误
==============================================================================
/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,但我不确定为什么管道没有说找不到路径
这是我的 docker 文件
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'
【问题讨论】:
-
您可以通过使用“pwd”命令检查您当前的工作目录并使用“ls -a”找到您要查找的文件的确切路径来解决此问题。将这些添加为任务,您将能够解决它。希望对您有所帮助。
标签: azure azure-devops azure-pipelines azure-aks azure-pipelines-yaml