bitbucket 管道 - aws:找不到命令

bitbucket Pipelines - aws: command not found

提问人:paul kendal23 提问时间:11/10/2023 更新时间:11/10/2023 访问量:33

问:

我有一个通往 AWS S3 的管道。由于以下原因,我的构建失败。

./devops/scripts/deploy-production.sh:第 35 行:AWS:找不到命令

在我的 deploy-production.sh 脚本中,第 35 行,我有以下代码:

aws s3 cp $BUNDLE $S3_BUCKET_ENDPOINT > /dev/null 2>&1

aws deploy create-deployment \
  --application-name $APPLICATION_NAME \
  --deployment-config-name $DEPLOYMENT_CONFIG_NAME \
  --deployment-group-name $DEPLOYMENT_GROUP_NAME \
  --file-exists-behavior OVERWRITE \
  --s3-location bucket=$S3_BUCKET_ENDPOINT,bundleType=tgz,key=bundles/$BUNDLE

我通过在上述脚本(build-for-production.sh 之前调用的脚本)拉入了 AWS:

npm run build

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
rm -rf ./aws
rm -f awscliv2.zip

# clean up
rm -rf ./aws
rm -rf awscliv2.zip

然后在我的bitbucket-pipelines.yml中

- step:
        name: 'Deploying to Production'
        deployment: production
        #        trigger: 'manual'
        script:
          - bash ./devops/build-server.sh
          - bash ./devops/build-for-production.sh
          - bash ./devops/scripts/deploy-production.sh
amazon-web-services bitbucket 管道

评论


答: 暂无答案