Circleci config.yml: 'Invalid template path ./.circleci/file.s/backend.yml'



我在名为Infrastructure Deployment的作业命令中编写了这段代码。

deploy-infrastructure:
docker:
- image: amazon/aws-cli
steps:
# Checkout code from git
- run:
name: Ensure back-end infrastructure exists
command: |
yum -y install gzip tar 
aws cloudformation deploy 
--template-file .circleci/files/backend.yml 
--stack-name "updapeople-backend-${CIRCLE_WORKFLOW_ID:0:7}" 
--parameter-overrides ID="${CIRCLE_WORKFLOW_ID:0:7}" 

但每次它都会给我同样的错误,我很确定这个名字是完全正确的。这个路径实际上在github上,我正在尝试为CI/CD构建一个全自动的Pipline。

您需要一个实际的checkout步骤(https://circleci.com/docs/configuration-reference#checkout)在此之前";确保后端基础设施的存在";步骤:

deploy-infrastructure:
docker:
- image: amazon/aws-cli
steps:
# Checkout code from git
- checkout
- run:
name: Ensure back-end infrastructure exists
command: |
yum -y install gzip tar 
aws cloudformation deploy 
--template-file .circleci/files/backend.yml 
--stack-name "updapeople-backend-${CIRCLE_WORKFLOW_ID:0:7}" 
--parameter-overrides ID="${CIRCLE_WORKFLOW_ID:0:7}"

最新更新