AWS代码部署 - 指定位置的脚本:脚本/validate_service.sh失败了出口代码1

发布于 2025-02-11 19:41:53 字数 443 浏览 2 评论 0原文

我的部署在上一步中失败了错误消息:

整体部署失败了,因为部署失败了太多,部署失败,很少有健康实例可用于部署,或者部署组中的某些实例遇到了问题。

事件日志

未选择行。

My validate_service.sh contain

    #!/bin/bash
    # verify we can access our webpage successfully

curl -v --silent localhost:80 2>&1 | grep Welcome

Can someone advice what should I change ?

My deployments fail on last step Validate Service with error message:

The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems.

Events log

No lines are selected.

My validate_service.sh contain

    #!/bin/bash
    # verify we can access our webpage successfully

curl -v --silent localhost:80 2>&1 | grep Welcome

Can someone advice what should I change ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神仙妹妹 2025-02-18 19:41:55

脚本返回值很重要。你对我看起来不错。我刚刚添加了几秒钟才等到应用程序启动。

如果您将bash -x与命令管道一起使用,则最好添加shopt -s PipeFail,因此当其中一个命令失败时,所有管道都会失败。

结帐我的脚本:

#!/bin/bash

sleep 5
curl http://localhost:3009 | grep Welcome

Script return value matters. Yours looks good to me. I just added couple of seconds to wait until application starts up.

In case you use bash -x together with pipeline of commands, you better add shopt -s pipefail so all pipeline fails when one of the commands fails.

Checkout my script:

#!/bin/bash

sleep 5
curl http://localhost:3009 | grep Welcome
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文