代码之家  ›  专栏  ›  技术社区  ›  Shamnad P S

Heroku部署无法使用赫罗库.yml

  •  2
  • Shamnad P S  · 技术社区  · 6 年前

    我使用Heroku自动部署heroku.yml 文件。

    而且发布步骤似乎永远在运行,它既没有失败也没有成功。

    有人能帮我做错事吗?

    以下是报告的内容赫罗库.yml文件。

    build:
      docker:
        web: Dockerfile
    release:
      image: web
    

    已经跑了20多分钟了,

    enter image description here

    Heroku日志看起来不错

    2018-09-17T16:29:17.000000+00:00 app[api]: Build started by user shamnad.shaji@xxx.com
    2018-09-17T16:32:11.000000+00:00 app[api]: Build succeeded
    2018-09-17T16:32:11.463973+00:00 app[api]: Deployed web (8711c8889299), release (8711c8889299) by user shamnad.shaji@xxx.com
    2018-09-17T16:32:11.463973+00:00 app[api]: Running release v8 commands by user shamnad.shaji@xxx.com
    2018-09-17T16:32:12.484201+00:00 app[api]: Starting process with command `if curl $HEROKU_RELEASE_LOG_STREAM --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then
    2018-09-17T16:32:12.484201+00:00 app[api]: /tmp/log-stream /bin/sh -c 'npm start'
    2018-09-17T16:32:12.484201+00:00 app[api]: else
    2018-09-17T16:32:12.484201+00:00 app[api]: chmod u+x /tmp/log-stream
    2018-09-17T16:32:12.484201+00:00 app[api]: npm start
    2018-09-17T16:32:12.484201+00:00 app[api]: fi` by user shamnad.shaji@xxx.com
    2018-09-17T16:32:26.348412+00:00 heroku[release.7596]: Starting process with command `if curl https://heroku-release-output.s3.amazonaws.com/log-stream?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=1234%2F20180917%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180917T163211Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=1234 --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then   chmod u+x /tmp/log-stream   /tmp/log-stream /bin/sh -c 'npm start' else   npm start fi`
    2018-09-17T16:32:26.941800+00:00 heroku[release.7596]: State changed from starting to up
    2018-09-17T16:32:28.128927+00:00 app[release.7596]: /bin/sh: curl: not found
    2018-09-17T16:32:28.615282+00:00 app[release.7596]:
    2018-09-17T16:32:28.615322+00:00 app[release.7596]: > mobile-services@0.0.0 start /backend
    2018-09-17T16:32:28.615324+00:00 app[release.7596]: > ts-node -r tsconfig-paths/register src/main.ts
    2018-09-17T16:32:28.615326+00:00 app[release.7596]:
    2018-09-17T16:32:30.751179+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [NestFactory] Starting Nest application...
    2018-09-17T16:32:30.763686+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [InstanceLoader] AppModule dependencies initialized +12ms
    2018-09-17T16:32:30.815330+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [RoutesResolver] AppController {/}: +52ms
    2018-09-17T16:32:30.819278+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [RouterExplorer] Mapped {/, GET} route +4ms
    2018-09-17T16:32:30.821509+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [NestApplication] Nest application successfully started +2ms
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Shamnad P S    6 年前

    因此,解决方案是添加一些内容作为release命令。很奇怪,但效果很好。告诉我这对谁有用。

    build:
      docker:
        web: Dockerfile
    release:
      image: web
      command:
        - echo 'Starting server after deployment!';